Forum Moderators: coopster

Message Too Old, No Replies

MySQL Sleeping Processes

         

HoboTraveler

5:07 am on Mar 10, 2008 (gmt 0)

10+ Year Member



Hi All,

Our server has been under load lately.

I ran the command "mysqladmin pro" and there seems to be a lot of sleeping processes. Why are these processes sleeping? I understand these processes consume memory, correct?

Btw, at the end of all my PHP scripts, I forcibly close the db connection.

mysql_close($db1);
mysql_close($db2);

The wait_timeout=1200. I cannot set it to a lower value since MySQL displays the following error, "Invalid query: MySQL server has gone away".

How do I ensure that all MySQL sleeping processes are closed and terminated.?

TIA

Habtom

11:12 am on Mar 16, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The methods you mentioned are the ones which should ensure you are not left with sleeping processes for a long time.

Could you be using mysql_pconnect instead of mysql_connect when you get connected to the database?

[edited by: Habtom at 11:17 am (utc) on Mar. 16, 2008]