python - SQLAlchemy raises QueuePool limit of size 10 overflow 10 reached, connection timed out after some time -
while using flask-sqlalchemy error 'queuepool limit of size 10 overflow 10 reached, connection timed out' consistently, after time. tried increase connection pool size, deferred 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
i figured out problem. issue database connection going lost state, causing pool size exhausted after interval.
fix issue made mysql server configuration change query timeout , made 1 second.
after 1 second if query didn't respond throw exception , added except block in code query invoked(in case query). in except block, issued rollback command.
Comments
Post a Comment