From modperl-return-63466-apmail-perl-modperl-archive=perl.apache.org@perl.apache.org Thu Oct 24 19:50:25 2013 Return-Path: X-Original-To: apmail-perl-modperl-archive@www.apache.org Delivered-To: apmail-perl-modperl-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D395B100E2 for ; Thu, 24 Oct 2013 19:50:25 +0000 (UTC) Received: (qmail 3683 invoked by uid 500); 24 Oct 2013 19:45:24 -0000 Delivered-To: apmail-perl-modperl-archive@perl.apache.org Received: (qmail 3594 invoked by uid 500); 24 Oct 2013 19:45:15 -0000 Mailing-List: contact modperl-help@perl.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list modperl@perl.apache.org Received: (qmail 3503 invoked by uid 99); 24 Oct 2013 19:45:07 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 24 Oct 2013 19:45:07 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of xzheng@christianbook.com designates 208.68.76.78 as permitted sender) Received: from [208.68.76.78] (HELO dmzpostal.cckh.com) (208.68.76.78) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 24 Oct 2013 19:45:01 +0000 Received: from tigger2.cbdadmin.com ([10.10.1.140]) by dmzpostal.cckh.com (8.12.8/8.12.8) with ESMTP id r9OJibHN009752; Thu, 24 Oct 2013 15:44:37 -0400 Received: from cougar.cbdadmin.com (cougar.cbdadmin.com [10.10.1.210]) by tigger2.cbdadmin.com (8.13.8/8.13.8) with ESMTP id r9OJidof012168; Thu, 24 Oct 2013 15:44:39 -0400 Received: from cougar.cbdadmin.com ([::1]) by cougar.cbdadmin.com ([::1]) with mapi id 14.02.0247.003; Thu, 24 Oct 2013 15:44:39 -0400 From: Xinhuan Zheng To: Perrin Harkins , xiaolan CC: "modperl@perl.apache.org" Subject: Re: mysql connection pooling Thread-Topic: mysql connection pooling Thread-Index: AQHOcwEGQhy97VVvMkq12p+bXPXhGJlKL7+AgLrNMIA= Date: Thu, 24 Oct 2013 19:44:38 +0000 Message-ID: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Microsoft-MacOutlook/14.3.8.130913 x-originating-ip: [10.10.182.55] Content-Type: multipart/alternative; boundary="_000_CE8EECFD53B16xzhengchristianbookcom_" MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org --_000_CE8EECFD53B16xzhengchristianbookcom_ Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable Hi Perrin, I am facing a similar issue with Oracle database. Tim's slides doesn=92t ex= plain details of implementation. I have Apache httpd with mod_perl and DBI.= Without many code changes, what does the proxy server look like to achieve= the database connection pooling? What is "Apache running DBI Gofer" as sho= wn in the slides page 26? Thanks, - xinhuan From: Perrin Harkins > Date: Thursday, June 27, 2013 3:05 PM To: xiaolan > Cc: "modperl@perl.apache.org" > Subject: Re: mysql connection pooling Hi, There is nothing exactly like the database pool in JDBC. However, there ar= e solutions for this problem. The first thing you should do is run a reverse proxy in front of your mod_p= erl server. That typically reduces the number of mod_perl processes by a f= actor of 10, i.e. 1000 mod_perl processes for 10,000 front-end proxy proces= ses. See http://perl.apache.org/docs/1.0/guide/strategy.html#Adding_a_Prox= y_Server_in_http_Accelerator_Mode Note that there are many lightweight proxy servers now that can act as a fr= ont-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 h= ere: http://search.cpan.org/~timb/DBI-1.627/lib/DBD/Gofer.pm#Connection_Poo= ling_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 > 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 1= 0000 connections to mysql, this make the DB crashed. Is there any software for modperl working like Java's JDBC for connection p= ooling? Thanks. --_000_CE8EECFD53B16xzhengchristianbookcom_ Content-Type: text/html; charset="Windows-1252" Content-ID: <8E3F13164EA5244F973D281E55C8464A@cbd.com> Content-Transfer-Encoding: quoted-printable
Hi Perrin,

I am facing a similar issue with Oracle database. Tim's slides doesn= =92t explain details of implementation. I have Apache httpd with mod_perl a= nd DBI. Without many code changes, what does the proxy server look like to = achieve the database connection pooling? What is "Apache running DBI Gofer" as shown in the slides page 2= 6? 

Thanks,
- xinhuan

From: Perrin Harkins <pharkins@gmail.com>
Date: Thursday, June 27, 2013 3:05 = PM
To: xiaolan <practicalperl@gmail.com>
Cc: "modperl@perl.apache.org" <modperl@perl.apache.org>
Subject: Re: mysql connection pooli= ng

Hi,

There is nothing exactly like the database pool in JDBC. &n= bsp;However, there are solutions for this problem.

The first thing you should do is run a reverse proxy in fro= nt 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 f= ront-end proxy processes.  See 
Note that there are many lightweight proxy servers now that= can act as a front-end for mod_perl, not just Apache httpd.


Tim's slides explaining how this was used in a real-world s= cenario are here:

- Perrin


On Thu, Jun 27, 2013 at 2:26 AM, xiaolan <practicalp= erl@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 o= pen 10000 connections to mysql, this make the DB crashed.
Is there any software for modperl working like Java's JDBC for connect= ion pooling?

Thanks.

--_000_CE8EECFD53B16xzhengchristianbookcom_--