Re: DBI persistence problem
[prev]
[thread]
[next]
[Date index for 2004/12/01]
--=-Mc48W3X63oOeNb+91Qlt
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
Malcom,
Thank you for your response.. It does sound like a possibility that the
script isn't all the way into completion as we have query->process
result->query->process result->query->disconnect (figuratively) scripts.
We were thinking of using SQLRelay as a connection pool and
concentrator, thinking it would be less expensive to wrap a
connection/cursor through a unix socket into a pool vs. throwing all
this at a remote server. Does that sound off-base in anyone's opinion?
Regards,
Rich
On Wed, 2004-12-01 at 18:10 -0500, Malcolm J Harwood wrote:
> On Wednesday 1 December 2004 08:26 pm, Richard N. Fogle wrote:
>
> > 1. We disabled Apache::DBI - the server can generate thousands of
> > queries per second and this feature literally made the CPU catch fire.
>
> Odd. Normally (in my limited experience) it has the reverse effect as you
> aren't creating and destroying a connection every time.
>
> > 3. We have a disconnect at the end of each perl CGI. Not sure if it is
> > being reached, see no plausible reason why it shouldn't - the code isn't
> > that complex.
>
> Worth checking anyway.
>
> > 4. This is what we have in httpd.conf:
> > SetHandler perl-script
> > PerlHandler Apache::Registry
>
> Registry will keep any globals around, so if $dbh is global it wont destroy it
> (though if disconnect is being called, it should disconnect it).
>
> > 5. We easily reach 1024 webserver processes, apache 1.3.
>
> If each one is connecting to the db server (assuming you don't have any
> interprocess connection pooling), then that's your 1024+ db connections right
> there. If the connections are made but not disconnected until the end of the
> script, you would (I think) see a lot of "idle" connections that don't have
> an active query (it's already completed) because they haven't reached the end
> of the script and been disconnected yet.
>
>
> --
> I always wanted to be somebody, but I should have been more specific.
> - Lily Tomlin
>
--=-Mc48W3X63oOeNb+91Qlt
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: 7bit
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.2.3">
</HEAD>
<BODY>
Malcom,<BR>
<BR>
Thank you for your response.. It does sound like a possibility that the script isn't all the way into completion as we have query->process result->query->process result->query->disconnect (figuratively) scripts. We were thinking of using SQLRelay as a connection pool and concentrator, thinking it would be less expensive to wrap a connection/cursor through a unix socket into a pool vs. throwing all this at a remote server. Does that sound off-base in anyone's opinion?<BR>
<BR>
Regards,<BR>
<BR>
Rich<BR>
<BR>
On Wed, 2004-12-01 at 18:10 -0500, Malcolm J Harwood wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
<FONT COLOR="#000000">On Wednesday 1 December 2004 08:26 pm, Richard N. Fogle wrote:</FONT>
<FONT COLOR="#000000">> 1. We disabled Apache::DBI - the server can generate thousands of</FONT>
<FONT COLOR="#000000">> queries per second and this feature literally made the CPU catch fire.</FONT>
<FONT COLOR="#000000">Odd. Normally (in my limited experience) it has the reverse effect as you </FONT>
<FONT COLOR="#000000">aren't creating and destroying a connection every time.</FONT>
<FONT COLOR="#000000">> 3. We have a disconnect at the end of each perl CGI. Not sure if it is</FONT>
<FONT COLOR="#000000">> being reached, see no plausible reason why it shouldn't - the code isn't</FONT>
<FONT COLOR="#000000">> that complex.</FONT>
<FONT COLOR="#000000">Worth checking anyway.</FONT>
<FONT COLOR="#000000">> 4. This is what we have in httpd.conf:</FONT>
<FONT COLOR="#000000">> SetHandler perl-script</FONT>
<FONT COLOR="#000000">> PerlHandler Apache::Registry</FONT>
<FONT COLOR="#000000">Registry will keep any globals around, so if $dbh is global it wont destroy it </FONT>
<FONT COLOR="#000000">(though if disconnect is being called, it should disconnect it).</FONT>
<FONT COLOR="#000000">> 5. We easily reach 1024 webserver processes, apache 1.3.</FONT>
<FONT COLOR="#000000">If each one is connecting to the db server (assuming you don't have any </FONT>
<FONT COLOR="#000000">interprocess connection pooling), then that's your 1024+ db connections right </FONT>
<FONT COLOR="#000000">there. If the connections are made but not disconnected until the end of the </FONT>
<FONT COLOR="#000000">script, you would (I think) see a lot of "idle" connections that don't have </FONT>
<FONT COLOR="#000000">an active query (it's already completed) because they haven't reached the end </FONT>
<FONT COLOR="#000000">of the script and been disconnected yet.</FONT>
<FONT COLOR="#000000">-- </FONT>
<FONT COLOR="#000000">I always wanted to be somebody, but I should have been more specific.</FONT>
<FONT COLOR="#000000">- Lily Tomlin</FONT>
</PRE>
</BLOCKQUOTE>
</BODY>
</HTML>
--=-Mc48W3X63oOeNb+91Qlt--