Mysql connection not dropping

sexy_guy

Well-Known Member
Mar 19, 2003
847
0
166
Im using Shauns Watchmysql program to monitor the number of mysql connections open by our users. Squirrelmail is using a Mysql database to store our user prefs. Since recompiling the entire box and upgrading to 1.3.28 i have received numerous emails from watchmysql thats telling me that the squirrelmail user has opened 12 connections. I get these messages every hour, but it seems mysql is not dropping the connections. :confused:

cPanel.net Support Ticket Number:
 

sexy_guy

Well-Known Member
Mar 19, 2003
847
0
166
** BUMP **

I had 137 mysql dbs open tonight on one box with 50 sites on it? WHY? Why is mysql not dropping the connections? Since upgrading to 1.3.28 we have had nothing but problem with Mysql sessions. Please fix this problem!

cPanel.net Support Ticket Number:
 

Website Rob

Well-Known Member
Mar 23, 2002
1,501
1
318
Alberta, Canada
cPanel Access Level
Root Administrator
Although I'm not sure about the SquirrelMail situation, I do know that open mySQL connections seem to be a fact of life. Running Apache 1.3.27 and no SM processes, I usually have 60 - 80 open connections. This is due to the PHP coding itself. Best way I've found for solving this "too many open mySQL connections" problem is to simply restart mySQL. How many times a day this is done depends on how many processes are left open.

cPanel.net Support Ticket Number:
 

sexy_guy

Well-Known Member
Mar 19, 2003
847
0
166
In my.cnf if you have it to drop very early there should be no reason why the connections should stay open. We had one site alone at 85 connections today and there are 250 sites on this one box.

cPanel.net Support Ticket Number:
 

Curious Too

Well-Known Member
Aug 31, 2001
437
2
318
cPanel Access Level
Root Administrator
Originally posted by Website Rob
Although I'm not sure about the SquirrelMail situation, I do know that open mySQL connections seem to be a fact of life. Running Apache 1.3.27 and no SM processes, I usually have 60 - 80 open connections. This is due to the PHP coding itself. Best way I've found for solving this "too many open mySQL connections" problem is to simply restart mySQL. How many times a day this is done depends on how many processes are left open.

cPanel.net Support Ticket Number:
Have you tried turning persistent connections off in the php.ini?

cPanel.net Support Ticket Number:
 

sexy_guy

Well-Known Member
Mar 19, 2003
847
0
166
Originally posted by Curious Too
Have you tried turning persistent connections off in the php.ini?

cPanel.net Support Ticket Number:
I have a script that i in the background and reports excessive mysql conections based on the user or site that is opening them. Yesterday i saw this all day.

Sat Aug 2 14:41:23 PDT 2003


2:41pm up 5 days, 1:11, 1 user, load average: 0.95, 0.66, 0.48
147 processes: 144 sleeping, 3 running, 0 zombie, 0 stopped
Mem: 1031244K av, 867624K used, 163620K free, 0K shrd, 77552K buff
Swap: 1024120K av, 64012K used, 960108K free 521024K cached

PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME COMMAND
31093 nobody 15 0 1088 1084 816 R 5.5 0.1 0:00 top
30412 nobody 15 0 17976 17M 17240 R 0.0 1.7 0:00 httpd


Http processes currently running = 37
Mysql processes currently running = 137 <===== HERE

Netstat information summary
4 LAST_ACK
15 TIME_WAIT
40 LISTEN
41 ESTABLISHED

This morning it was the same old thing, 137. Then i turned persistent_connection to off but im not sure that this is the answer. After turning it off i see

Http processes currently running = 44
Mysql processes currently running = 13

Which is about right.

Ever since we upgraded to Apache 1.3.28 the number of open mysql connections have sky rocketed. This is not normal.

wait_timout, interactive_timout are set very low yet these connections are not dropping. Either this is a mysql bug or a cpanel issue. All i can say is that this is not happening on our 1.3.27 boxes.

cPanel.net Support Ticket Number:
 
Last edited:

rpmws

Well-Known Member
Aug 14, 2001
1,787
10
318
back woods of NC, USA
sexy_guy said:
I have a script that i in the background and reports excessive mysql conections based on the user or site that is opening them. Yesterday i saw this all day.

Sat Aug 2 14:41:23 PDT 2003


2:41pm up 5 days, 1:11, 1 user, load average: 0.95, 0.66, 0.48
147 processes: 144 sleeping, 3 running, 0 zombie, 0 stopped
Mem: 1031244K av, 867624K used, 163620K free, 0K shrd, 77552K buff
Swap: 1024120K av, 64012K used, 960108K free 521024K cached

PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME COMMAND
31093 nobody 15 0 1088 1084 816 R 5.5 0.1 0:00 top
30412 nobody 15 0 17976 17M 17240 R 0.0 1.7 0:00 httpd


Http processes currently running = 37
Mysql processes currently running = 137 <===== HERE

Netstat information summary
4 LAST_ACK
15 TIME_WAIT
40 LISTEN
41 ESTABLISHED

This morning it was the same old thing, 137. Then i turned persistent_connection to off but im not sure that this is the answer. After turning it off i see

Http processes currently running = 44
Mysql processes currently running = 13

Which is about right.

Ever since we upgraded to Apache 1.3.28 the number of open mysql connections have sky rocketed. This is not normal.

wait_timout, interactive_timout are set very low yet these connections are not dropping. Either this is a mysql bug or a cpanel issue. All i can say is that this is not happening on our 1.3.27 boxes.

cPanel.net Support Ticket Number:
Thank goodness it's not just me. I have 6 boxs and 2 of them are RHEL band new boxes one has 6 sites on it and one with 55. Top shows 190 running processes, I kill and restart mysqld and it drops to 98 - 100 instantly. ps reports the same results. Funny thing is all of these sites were on other RH7.3 and RH9 boxes and they were packed with sites and doing like 300GB month and never did I see loads and that # of open mysqls.
 

rpmws

Well-Known Member
Aug 14, 2001
1,787
10
318
back woods of NC, USA
thaphantom said:
why dont you update to apache 1.3.31? Why run an old version?
In my case I been using 1.3.31 on all my boxes since nick put out the buildapache.sea.