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

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -