perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Malcolm J Harwood <>
Subject Re: DBI persistence problem
Date Wed, 01 Dec 2004 22:36:44 GMT
On Wednesday 1 December 2004 08:00 pm, Richard N. Fogle wrote:

> Basically, we have one MySQL cluster setup for reads and the other
> cluster for writes - the reads cluster alternates between master and
> slave.  This works fine.  The problem we're having is each time the CGI
> is called it seems to make a persistent connection to the database
> despite the fact that we have a $dbh->disconnect(); at the end of the
> code.  

Are you running Apache::DBI?
If not, are you sure that the disconnect call is being reached on each 
Are you running under PerlRun, Registry or your own handler?

> This causes the application to work well for a period of time, 
> but it will quickly run the databases out of processes (despite raising
> max_connections to 1024+) and when we go into MySQL to look at the
> process list it shows a bunch of sleeping connections!

How many webserver processes do you have running? 

> Appreciate any assistance anyone could provide, is mod_perl caching
> these scripts 

That is one of the things mod_perl does.

> and making the database connections persistent? 

That depends on what handler you are using, amongst other things.

"Let's just say that if complete and utter chaos was lightning, he'd
be the sort to stand on a hilltop in a thunderstorm wearing wet copper
armour and shouting 'All gods are bastards'."
-- Rincewind about Twoflower, The Colour of Magic

Report problems:
Mail list info:
List etiquette:

View raw message