John ORourke wrote:
It does make a separate DB connection in each apache process but I think trying to share 1 DB connection between httpd's is probably going to cost more than it gains.

It's not actually possible to share a connection between processes unless your database library explicitly supports it, like Sybase.

In the DB-related module be sure to include a 'ping' method so your mod_perl module can reconnect if the DB connection drops.

Create a new instance of the mod_perl handler module during startup and refer to that for the handlers (code below). This module would then cache DB connections and provide a method for 'create or fetch current DB connection'.

DBI->connect_cached will do all of this for you.

- Perrin

Reply via email to