[Catalyst] Database connections leaking

Jon Schutz jon+catalyst at youramigo.com
Sat Dec 22 05:04:14 GMT 2007


On Fri, 2007-12-21 at 21:32 -0700, Kevin Nathan wrote:

> 
> I can't check the server right now (need to be at work for that), but I
> didn't think to watch for Apache/mod_perl processes. What we were
> looking for was port 5432 connections (postgres). When it works, we get
> two or three connections per login and they stay steady. When it's not
> working, they continuously increase until config limit is reached
> (we've gone as high as 3000 connections). 
> 
> It will be a few days now, before I can check it again unless I get
> some time to drive to the colocation, but I will check for the Apache
> processes. If they are going up, too, where should I look? Any hints
> (or websites) that may help?
> 
> Thanks for the quick response!
> 

It seems to me you would know about it, one way or another, if you had
3000 apache processes!

I would speculate that the logic in Catalyst::Model::DBI that checks
whether it currently has an active connection, is not working for remote
Postgres connections, so it keeps creating new ones.  I suggest (a)
making sure you have the latest version of DBI and DBD::pg and postgres
libraries, and if that doesn't solve it, (b) add debug into
Catalyst::Model::DBI stay_connected sub to find out which bit of the
logic is causing a reconnect.

As I'm not much of a postgres or mod_perl user, I bow out here and let
the experts take over...


-- 

Jon Schutz                        My tech notes http://notes.jschutz.net
Chief Technology Officer                        http://www.youramigo.com
YourAmigo         



More information about the Catalyst mailing list