Malcom and Perrin,

Thank you for your quick replies!

1.  We disabled Apache::DBI - the server can generate thousands of queries per second and this feature literally made the CPU catch fire.
2.  Understood about placing the connect strings in startup.PL.  That's why we wrote the list first :)
3.  We have a disconnect at the end of each perl CGI.  Not sure if it is being reached, see no plausible reason why it shouldn't - the code isn't that complex.
4.  This is what we have in httpd.conf:
SetHandler perl-script
PerlHandler Apache::Registry
PerlSendHeader On
Options +ExecCGI
5.  We easily reach 1024 webserver processes, apache 1.3.
6.  We have not verified anything with tracing.

Does this answer all the questions?


On Wed, 2004-12-01 at 17:39 -0500, Perrin Harkins wrote:
On Wed, 2004-12-01 at 19:00 -0600, Richard N. Fogle wrote:
> The problem we're having is each time the CGI is called it seems to
> make a persistent connection to the database despite the fact that we
> have a $dbh->disconnect(); at the end of the code.

Are you using Apache::DBI anywhere?  Make sure.  Have you verified that
the disconnect really gets called?  You can turn DBI tracing on to find
out what's happening.  I would suggest that you might be trapping a copy
of your $dbh in a closure or a global, but that shouldn't matter if you
actually call disconnect() on it.

> We tried placing the connect strings in startup.PL

Don't do that!  Opening database connections before the server forks
will wreak havoc when multiple processes try to use the same socket.

- Perrin


Reply via email to