I am having trouble investigating a problem with many sleeping MySQL connections.
Once in a day or two, I notice that all (151) MySQL connections and all of them seem to be sleeping.
I researched this, and one of the most sensible explanations is that the PHP script was just killed, leaving a MySQL connection. We record visits at the beginning of the request and update this log when the request ends, so we can say that indeed some requests actually begin, but do not end, which indicates that the script was somehow killed.
Now, worry that this only happens for 1 specific user and only on one specific page. The page works for everyone else, and when I log in as this user in the production environment and perform the same action, everything works fine.
Now I have two questions:
I would like to know why the PHP script is killed . Could this have anything to do with the client? Can the client do something to complete the request and kill the php script? If so, why don't I see any evidence of this in Apache logs? Or maybe I don’t know what to look for? How to find out if a script was really killed or what caused it?
? mysql PHP? - mysql ? , , , 151 2 . . , .. , 1 ?
, , 1 . .
.