While using Flask-SQLAlchemy I get the error 'QueuePool limit of size 10 overflow 10 reached, connection timed out' consistently, after some time. I tried to increase connection pool size, but it only deferred the problem.
def create_app(config_name):
app = Flask(__name__)
app.config.from_object(config[config_name])
config[config_name].init_app(app)
initialize_db(app)
db = SQLAlchemy()
def initialize_db(app):
db.init_app(app)
SQLALCHEMY_POOL_SIZE = 100