[Modules] mod_dbi_pool and mod_vhost_dbi

Matthew Kent matt at bravenet.com
Fri Apr 29 11:11:24 EST 2005

I'm having an interesting problem with mod_dbi_pool being used by
mod_vhost_dbi in a fairly busy site. It's configured like:

PoolDbiConnMin        Server1  10
PoolDbiConnSoftMax    Server1  15
PoolDbiConnHardMax    Server1  20
PoolDbiConnTTL        Server1  60

Everything works great for 15-45 minutes. I can see 10 connections to
the MySQL server from the webserver, I see the idle times get set to 0
as the connections are reused, they never get above 30 seconds or so. 

But then I get an error

[Fri Apr 29 08:50:24 2005] [error] cached_vhost_dbi:  get_path: SQL
Error: (2013) 2013: Lost connection to MySQL server during query on
query: select domain as [snip]

Which has a corresponding error on mysql's side

050429  8:50:31 Aborted connection 728491 to db: 'xxxxx' user: 'wwwsite'
host: `xxx.xx.x.xx' (Got an error reading communication packets)

But the real problem is that once this happens, within a few seconds it
makes a whole whack of new connections to the backend. Like 30+ which is
more than the ConnHardMax. They don't obey the TTL making me think it's
losing track of these connections or just creating them in error.

This also keeps reoccurring, so instead of 10-20 connections to the
backend right now the webserver has 140 open (almost all idling). I'm
sure I can decrease these by setting the timeout lower on the MySQL
server, but thats not really the root of the problem.

Software is as follows:

httpd 2.0.53
libdbi 0.7.2
libdbi drivers 0.7.1
MySQL 4.0.24 (client and server)

Not sure what else to try, my understanding of apache 2 modules and
libdbi aren't good enough to do much. I'm open for suggestions.

Btw thanks for writing these modules and making them available, I've
really learned a lot and come up with some ideas for internal projects.
Matthew Kent \ SA \ bravenet.com

More information about the Modules mailing list