On Wed, 2005-07-06 at 18:11 +0000, Mark Stosberg wrote:
> On the front end web server machine, the CPU spiked up well beyond
> average and stayed there. On the backend PostgreSQL 7.4 server, we saw
> a number or errors that that the number of max connections had been
> exceeded.

The CPU spike sounds a bit unusual, but there are ways it could result
from failing to connect to your db.  Was it really CPU that spiked, or
just load?  The load can spike in this case because the server spawns
too many processes.  Make sure your MaxClients is tuned to something you
can actually support.

> I'm curious: What is the expected behavior from Apache::DBI in this
> case? Would it quickly give up and move on, or perhaps continuously ping
> the database server and wait, creating a high CPU load in the Perl
> process?

Apache::DBI doesn't change the behavior of your app in this case.  It
will either fail to make a new connection or fail to ping at the
beginning of a request.  Either way, you'll get no db handle back, and
if you have RaiseError on you should see an exception.  Maybe your code
for handling that exception is not well-behaved?  It should probably
just send an error page and get out.

- Perrin

Reply via email to