Re: DBI persistence problem

[prev] [thread] [next] [Date index for 2004/12/01]

From: Malcolm J Harwood
Subject: Re: DBI persistence problem
Date: 22:36 on 01 Dec 2004
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 
connection?
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: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html

DBI persistence problem
Richard N. Fogle 01:00 on 02 Dec 2004

Re: DBI persistence problem
Malcolm J Harwood 22:36 on 01 Dec 2004

Re: DBI persistence problem
Perrin Harkins 22:39 on 01 Dec 2004

Re: DBI persistence problem
Richard N. Fogle 01:26 on 02 Dec 2004

Re: DBI persistence problem
Malcolm J Harwood 23:10 on 01 Dec 2004

Re: DBI persistence problem
Richard N. Fogle 23:48 on 01 Dec 2004

Re: DBI persistence problem
Perrin Harkins 19:16 on 02 Dec 2004

Re: DBI persistence problem
Rob Mueller 19:46 on 02 Dec 2004

Generated at 11:26 on 21 Dec 2004 by mariachi v0.52