My backend configuration is :
TimeoutError: QueuePool limit of size 5 overflow 10 reached, connection timed out, timeout 30
Flask-SQLAlchemy manages the connection pool for you, so in general, it should not be necessary to do this. However, there are some instances in which it cannot control this, specifically if you are executing queries outside a request context or using
with app.app_context() somewhere.
When I paired Flask-SQLAlchemy with apscheduler, I found myself having to explicitly close sessions in the jobs the scheduler executed, or after several hours of running I would get this error.