One of the main problems our system has experienced is the "too many connections" error with MySQL. We can go in, do a "show processlist", and a great number of processes will just be sitting there, sleeping.
One problem is the timeout...I believe it defaults to around 7 hours. That's easy enough to change. An hour is what we're planning on changing it to.
The second problem is the number of connections, which was sitting at 500. I don't know an acceptable number for this. The server has 4 P-II-400's.
The third problem is the code itself. Many old scripts don't disconnect properly. We're planning on going through these, but there's a lot to do.
What I'm wondering is this: is it possible to have the Perl DBI ->disconnect database handles automatically when the script is exited, or exec's to another script? In other words, is there an option somewhere for this? I may be crazy, but I really thought I read in O'Reilly's "Programming the Perl DBI" book that you did not have to explicitly disconnect database handles.
Thanks very much in advance for any help.
I really don't expect that the "auto disconnect" is available, but it's worth a shot. Also, if someone can give me a good number for maximum connections allowed, I would greatly appreciate it.
Dale
The number of connections [dev.mysql.com] to use all depends on your OS. Also, it is good practice to always disconnect [oreilly.com] before ending a script.