[prev in list] [next in list] [prev in thread] [next in thread] 

List:       apache-modperl
Subject:    Re: mysql connection pooling
From:       xiaolan <practicalperl () gmail ! com>
Date:       2013-06-28 2:09:15
Message-ID: CAKr5UA5jECC=ntC2=2CVZQ3UDyFQ6C9U9y9nLjozDzEPody7Rg () mail ! gmail ! com
[Download RAW message or body]

Thank you Perrin.
Yes I should use Nginx as a reverse-proxy for modperl appservers, but I
don't yet. I will check it.
Thanks.


On Fri, Jun 28, 2013 at 3:05 AM, Perrin Harkins <pharkins@gmail.com> wrote:

> Hi,
>
> There is nothing exactly like the database pool in JDBC.  However, there
> are solutions for this problem.
>
> The first thing you should do is run a reverse proxy in front of your
> mod_perl server.  That typically reduces the number of mod_perl processes
> by a factor of 10, i.e. 1000 mod_perl processes for 10,000 front-end proxy
> processes.  See
> http://perl.apache.org/docs/1.0/guide/strategy.html#Adding_a_Proxy_Server_in_http_Accelerator_Mode
>
> Note that there are many lightweight proxy servers now that can act as a
> front-end for mod_perl, not just Apache httpd.
>
> That's definitely what you should do first, but if you've done that and
> it's still not enough, you can also use DBD::Gofer.  There is an
> explanation here:
> http://search.cpan.org/~timb/DBI-1.627/lib/DBD/Gofer.pm#Connection_Pooling_and_Throttling
>
> Tim's slides explaining how this was used in a real-world scenario are
> here:
> http://www.slideshare.net/Tim.Bunce/dbdgofer-200809
>
> - Perrin
>
>
> On Thu, Jun 27, 2013 at 2:26 AM, xiaolan <practicalperl@gmail.com> wrote:
>
>> Hi,
>>
>> Currently I have been using Apache::DBI for long connections to Mysql.
>> But having the problem that, if the apache processes are 10000, they open
>> 10000 connections to mysql, this make the DB crashed.
>> Is there any software for modperl working like Java's JDBC for connection
>> pooling?
>>
>> Thanks.
>>
>
>

[Attachment #3 (text/html)]

<div dir="ltr">Thank you Perrin.<div style>Yes I should use Nginx as a reverse-proxy \
for modperl appservers, but I don&#39;t yet. I will check it.</div><div \
style>Thanks.</div></div><div class="gmail_extra"><br><br><div class="gmail_quote"> \
On Fri, Jun 28, 2013 at 3:05 AM, Perrin Harkins <span dir="ltr">&lt;<a \
href="mailto:pharkins@gmail.com" target="_blank">pharkins@gmail.com</a>&gt;</span> \
wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px \
#ccc solid;padding-left:1ex"> <div dir="ltr">Hi,<div><br></div><div>There is nothing \
exactly like the database pool in JDBC.   However, there are solutions for this \
problem.</div><div><br></div><div>The first thing you should do is run a reverse \
proxy in front of your mod_perl server.   That typically reduces the number of \
mod_perl processes by a factor of 10, i.e. 1000 mod_perl processes for 10,000 \
front-end proxy processes.   See  <a \
href="http://perl.apache.org/docs/1.0/guide/strategy.html#Adding_a_Proxy_Server_in_http_Accelerator_Mode" \
target="_blank">http://perl.apache.org/docs/1.0/guide/strategy.html#Adding_a_Proxy_Server_in_http_Accelerator_Mode</a></div>


<div><br></div><div>Note that there are many lightweight proxy servers now that can \
act as a front-end for mod_perl, not just Apache \
httpd.</div><div><br></div><div>That&#39;s definitely what you should do first, but \
if you&#39;ve done that and it&#39;s still not enough, you can also use DBD::Gofer.   \
There is an explanation here:  <a \
href="http://search.cpan.org/~timb/DBI-1.627/lib/DBD/Gofer.pm#Connection_Pooling_and_Throttling" \
target="_blank">http://search.cpan.org/~timb/DBI-1.627/lib/DBD/Gofer.pm#Connection_Pooling_and_Throttling</a></div>


<div><br></div><div>Tim&#39;s slides explaining how this was used in a real-world \
scenario are here:</div><div><a \
href="http://www.slideshare.net/Tim.Bunce/dbdgofer-200809" \
target="_blank">http://www.slideshare.net/Tim.Bunce/dbdgofer-200809</a><span \
class="HOEnZb"><font color="#888888"><br>

</font></span></div><span class="HOEnZb"><font color="#888888"><div><br></div><div>- \
Perrin</div></font></span></div><div class="HOEnZb"><div class="h5"><div \
class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Jun 27, 2013 at 2:26 AM, \
xiaolan <span dir="ltr">&lt;<a href="mailto:practicalperl@gmail.com" \
target="_blank">practicalperl@gmail.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"><div dir="ltr">Hi,<div><br></div><div>Currently I have been \
using Apache::DBI for long connections to Mysql.</div><div>

But having the problem that, if the apache processes are 10000, they open 10000 \
connections to mysql, this make the DB crashed.</div> <div>Is there any software for \
modperl working like Java&#39;s JDBC for connection \
pooling?</div><div><br></div><div>Thanks.</div></div> </blockquote></div><br></div>
</div></div></blockquote></div><br></div>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic