Hi. On Sun, Sep 30, 2001 at 01:11:52PM -0400, [EMAIL PROTECTED] wrote: > I am running Apache with mod_perl (Apache::DBI is off) with connections to > MySQL. > > I'm finding that the number of connections used by perlhttpd seems to be > too high. I did this: > > [root@sg3 root]# ps -A | grep mysqld | wc > 88 353 2743 > [root@sg3 root]# /etc/httpd/bin/perlhttpdctl restart > /etc/httpd/bin/perlhttpdctl restart: httpd restarted > [root@sg3 root]# ps -A | grep mysqld | wc > 15 61 480 > > Restarting perlhttpd freed up 73 connections, but it shouldn't have been > using that many connections
That means that you have pending connections. This can happen if you use persistent connections or forget to close connection. > (perlhttpd has MaxClients set to 15). That only limits the number of clients at a time. After some time, each httpd client will have served a page with mod_perl and apparently there is the "leak". > I'm getting "Too many connections" error on the server about every 12 > hours now; there seems to be a leak in the number of connections. > > Can anyone suggest a solution to this? Simply set the max number of connection higher as the allowed number of httpd clients. It doesn't really hurt to have pending connections to your MySQL. > BTW, I don't use $dbh->disconnect in my scripts. Is that a problem? Of course. In this case, repairing your scripts is the better solution. The suggestion to increase the max_connection assumed that you use persistent connections. Bye, Benjamin. -- [EMAIL PROTECTED] --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php