Got an interesting problem I've never dealt with before, soliciting advice openly.
So I've got a mysql database sitting on an Amazon RDS server. About a week ago, this fucker started to buld up sleeping processes ... to the point it crashed the database. Website was displaying something to the tune of "too many database connections"
So here was my "fix"
Forgive the $ above, vbulletin wouldn't let me submit that sql query.
So originally, a cron hits that script every few minutes and it loops to kill all sleeping processes.
Here's a screenshot of my db connections logs over at amazon
The big hump from a week ago shows when I implemented this "fix" the first time (2nd big hump I moved the fix to run every minute) ... you can see it's steadily rising after the 2nd crash.
I have no confidence I've "solved" the problem and am looking for input as to why I've all of a sudden got a lot of zombie connections showing up. Rebooting the instance doesn't drop the connections back to zero anymore. Any suggestions?
So I've got a mysql database sitting on an Amazon RDS server. About a week ago, this fucker started to buld up sleeping processes ... to the point it crashed the database. Website was displaying something to the tune of "too many database connections"
So here was my "fix"
PHP:
$q = mysql_query("$elect id from information_$chema.proce$$list where user='database_username' and Command = 'Sleep'") ;
for($i=0; $i<mysql_numrows($q); $i++) {
mysql_query("KILL ".mysql_result($q,$i,'id').";") ;
}
So originally, a cron hits that script every few minutes and it loops to kill all sleeping processes.
Here's a screenshot of my db connections logs over at amazon
The big hump from a week ago shows when I implemented this "fix" the first time (2nd big hump I moved the fix to run every minute) ... you can see it's steadily rising after the 2nd crash.
I have no confidence I've "solved" the problem and am looking for input as to why I've all of a sudden got a lot of zombie connections showing up. Rebooting the instance doesn't drop the connections back to zero anymore. Any suggestions?