in reply to Disconnecting from a Database

If you are using Apache as your server, you should be using mod_perl v 1.24 or higher and Apache::DBI to provide connection pooling. Simply stated, Apache::DBI will keep a certain number of database connections open and will ignore your connect/disconnect method calls so you won't have to modify your code.

I am not guaranteeing that this will improve things for you, but I think it is fair to say that Apache::DBI is generally perceived to be a performance enhancer.

I have noticed garbage collection issues with the version of Oracle (I know you are using MySQL) in which even though I am explicitely closing my cursors and undefing my $STH's after I am done. In Oracle, there is a way to check and see if you have open cursors after the program has finished executing. Leaving open cursors has catastrophic effects on the performance of your httpd causing it to suck all available CPU and memory and thus bringing your server's performance to its knees. If you are experiencing similar problems, see if there is a way to detect open cursors after your program executes. Also, if you are not already doing so, you should be doing an $STH->finish on every statement handle after you are done using it.