Return-Path: Delivered-To: apmail-perl-modperl-archive@www.apache.org Received: (qmail 19940 invoked from network); 11 Feb 2009 16:20:10 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 11 Feb 2009 16:20:10 -0000 Received: (qmail 65079 invoked by uid 500); 11 Feb 2009 16:20:05 -0000 Delivered-To: apmail-perl-modperl-archive@perl.apache.org Received: (qmail 65065 invoked by uid 500); 11 Feb 2009 16:20:05 -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 65056 invoked by uid 99); 11 Feb 2009 16:20:04 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 Feb 2009 08:20:04 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of iheffner@gmail.com designates 209.85.200.168 as permitted sender) Received: from [209.85.200.168] (HELO wf-out-1314.google.com) (209.85.200.168) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 Feb 2009 16:19:58 +0000 Received: by wf-out-1314.google.com with SMTP id 27so241118wfd.7 for ; Wed, 11 Feb 2009 08:19:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=HRkh/QxRoSkmLMxqhbElMckyeiNGz6VPAD/VnN73pos=; b=wpOLhJnrlFzgPAU01lK2ClhRL7mEu7oTkxnjq6jvX6XJ4ziLV6FroYVl8dWxRlVrDu Q7rlWhayuMr/wPMX6SAAujfExtNFrloJUTLMk/UqmuPnODX18lV8FsVW4xuV9c2FMJ2k Od7JBvWtRvxEf+HOrQxtC6RKaqmZYZs7n0vVE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=KbBZEMZgUuzv74EXkq1WXVpjPqdrKx5DcX5E0NHMQt3oBbaB0DG19dsegmMzq8CnOW 4G191q9VcFHKX7f1eHWqHEn40ybbyCG0tkYm2agGiK9p7LcqGUBxJh1Nld76P6vQ0utL ars9GMpef5/YZtJ2ifbZFpa7wbxC/XhCFXDkg= MIME-Version: 1.0 Received: by 10.141.41.12 with SMTP id t12mr1993351rvj.289.1234369178107; Wed, 11 Feb 2009 08:19:38 -0800 (PST) In-Reply-To: References: Date: Wed, 11 Feb 2009 08:19:38 -0800 Message-ID: Subject: Re: mod_perl2 with mod_dbd and Apache2 From: Ivan Heffner To: Timothy Partee Cc: modperl@perl.apache.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org I realize that this response is months late, but this thread is only now coming to my attention due to another recent response. Still, I think you may have been trying to solve the wrong problem. Perhaps I'm missing a detail or two here, but you are running mod_perl. Perl processes live on beyond the time to service one request. Why don't you set up a PerlChildInitHandler that establishes your database connection and holds on to it? $dbh = DBI->connect_cached($data_source, $username, $password, \%attr) or die $DBI::errstr; As long as you are not running so many severs / children that you saturate you DB connection limit, you should be fine. Ivan On Wed, Aug 27, 2008 at 1:15 AM, Timothy Partee wrote: > > Quick question for the list. I've been scouring Google looking for > information on Connection Pooling to MySQL 5.0 in mod_perl2 on Apache2 using > mod_dbd or similar, and while I can find docs for configuring mod_dbd in > Apache2, and am quite familiar with mod_perl development, I'm unable to find > specific examples online for how to code mod_perl to access mod_dbd > connection pools via APR... Am I completely on the wrong track? Is there > another more simple way to implement MySQL DBI connection pooling in > mod_perl? > I'm running a website that is starting to get enough traffic that opening > a fresh DB connection via Perl's DBI libs on each request is starting to > cost me serious time in serving mod_perl pages through Apache2, and I'd like > to implement connection pooling to improve performance. Any suggestions or > URLs that could help me get on the right track would be muchly appreciated! > > Thanks, > > - Tim Partee > >