0

We are connecting to a MySQL database using SQLAlchemy.

eng = create_engine(uri, pool_size=25, pool_recycle=60, pool_pre_ping=True)

When we monitor the pool, we see that the number of checkedin connections keep increasing while the number of checkedout connections is pretty stable (around 3, for instance).

After a while, the number of checkedin connections reaches the maximum and the software starts to fail TimeoutError: QueuePool limit.

I had already investigated and we call close at the end of every session. We are using a try-finally block for every session usage.

Did someone face this problem? Do you have ideas on how to investigate what connections are hung?

  • Please [edit] your question and add more details like the `try/finally` blocks you use and possibly a redacted URI. You should also set `echo_pool="debug"` to track the pool events and post those logs in your question. – ljmc Dec 29 '22 at 14:24

0 Answers0