0

MySQL 5.7 shows 3 sleeping processes in the processlist while I run my application. This is preventing Alter Table commands and is kind of worrying me as it will persumably not scale as I deploy more services.

From Python MySQLdb: connection.close() VS. cursor.close() I have learned how to close a connection properly in Python. This has fixed 1 sleeping connection (comming from 4), but still there are 3 open.

How can I identify what the connection is causing in order to track down the python code which is not closing it?

merlin
  • 2,717
  • 3
  • 29
  • 59
  • Find the port the connection comes from (`SHOW STATUS`) and on the client check which process opened the connection (`netstat …`). – Klaus D. Dec 08 '20 at 08:51
  • Could you please be more specific? The processlist shows the host and I know that is a pyhthon script I started. It is just unclear to me where in the code with all the classes and methods I forgot to close a connection (or where I should close) – merlin Dec 08 '20 at 08:57

0 Answers0