perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Perrin Harkins" <>
Subject Re: Lost connection to MySQL server during query (was "Segfault when connecting during Apache startup")
Date Mon, 30 Jun 2008 15:10:53 GMT
On Mon, Jun 30, 2008 at 11:02 AM, Tobias Kremer <> wrote:
> According to the docs Apache::DBI
> should automatically avoid caching this connection.

It's not Apache::DBI that's caching it -- you're caching it.  Don't
put a database handle in a global before you fork.  It will stay, and
there's nothing Apache::DBI can do about it.

You are probably not reusing this connection, but you don't need to.
It will sit there, open, and eventually time out, which will cause the
error messages you see and also trigger cleanup on the server side.
The server side cleanup may hurt other open connections from the same

So, never put a database handle in a global during startup.

- Perrin

View raw message