[Catalyst] Initial connection pool issue with CDBI and MySQL
Matt S Trout
dbix-class at trout.me.uk
Sat Jan 28 16:48:51 CET 2006
On Fri, Jan 27, 2006 at 04:40:56PM -0800, Dylan Vanderhoof wrote:
> I'm seeing some strange behavior on the first large chunk of requests
> coming into Catalyst.
> The environment is a single catalyst page that has a bunch of img tags
> that call catalyst-handled dynamically generated images.
> The first time the page is loaded, after an apache reload/restart, about
> half the images fail to load. A refresh loads all of them (none are
> cached at any point), and all subsequent refreshes seem to work.
> Any ideas what might be happening? It doesn't appear to be a longterm
> problem, but I can't seem to figure out what is causing it for the
> initial request. As best I can tell Catalyst/CDBI just doesn't have
> enough DB connections open to handle all the requests, but it doesn't
> seem to be like it should be failing for any, just being slower than
> subsequent requests.
Either you're opening a connection before apache fork, so they end up
sharing a $dbh, or you've got mysql_auto_reconnect set.
Under mod_perl, both CDBI and DBIC will result in one connection per apache
child, so "doesn't have enough" isn't really possible :)
Matt S Trout Offering custom development, consultancy and support
Technical Director contracts for Catalyst, DBIx::Class and BAST. Contact
Shadowcat Systems Ltd. mst (at) shadowcatsystems.co.uk for more information
+ Help us build a better perl ORM: http://dbix-class.shadowcatsystems.co.uk/ +
More information about the Catalyst