Return-Path: Delivered-To: apmail-perl-modperl-archive@www.apache.org Received: (qmail 14227 invoked from network); 16 Nov 2009 09:11:12 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 16 Nov 2009 09:11:12 -0000 Received: (qmail 14162 invoked by uid 500); 16 Nov 2009 09:11:10 -0000 Delivered-To: apmail-perl-modperl-archive@perl.apache.org Received: (qmail 14104 invoked by uid 500); 16 Nov 2009 09:11:09 -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 14096 invoked by uid 99); 16 Nov 2009 09:11:09 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 16 Nov 2009 09:11:09 +0000 X-ASF-Spam-Status: No, hits=-2.6 required=5.0 tests=BAYES_00 X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [84.21.226.211] (HELO corpmail.itlegion.ru) (84.21.226.211) by apache.org (qpsmtpd/0.29) with SMTP; Mon, 16 Nov 2009 09:11:07 +0000 Received: (qmail 9342 invoked from network); 16 Nov 2009 12:10:43 +0300 Received: from unknown (HELO ?192.168.0.12?) (192.168.0.12) by 84.21.226.211 with SMTP; 16 Nov 2009 12:10:43 +0300 Message-ID: <4B011702.7070402@itlegion.ru> Date: Mon, 16 Nov 2009 12:10:26 +0300 From: Artem Kuchin Organization: IT Legion User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Perrin Harkins CC: "David E. Wheeler" , "Kulasekaran, Raja" , modperl@perl.apache.org Subject: Re: DBI Connectons accumulate under Mod_perl References: <4ADDEC61.2080300@itlegion.ru> <4AF9810E.9050001@itlegion.ru> <1440789C-0B10-44FC-A6CE-6256FA08EE85@kineticode.com> <4AFD2B24.1010100@itlegion.ru> <66887a3d0911131040v4f4e6cbeud9e032dd2da854f6@mail.gmail.com> In-Reply-To: <66887a3d0911131040v4f4e6cbeud9e032dd2da854f6@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Perrin Harkins: > On Fri, Nov 13, 2009 at 4:47 AM, Artem Kuchin wrote: > >> Nope, i don't use those. Just plain DBI. Parent process does not open up any >> connections. >> > > This is getting really confusing because two of you are on this thread > with completely different problems. > > Artem, if you aren't using Apache::DBI and your connections are > building up, it means you're keeping the connections around in a > global or closure variable and not calling disconnect. Since you > aren't using something to keep your connections persistent, you should > call disconnect at the end of every request. You should also look at > your code to see if you put $dbh in a global somewhere. > > - Perrin > I am the original poster. Someone else has stolen my thread. Anyway. I AM calling disconnect and the thing is wrapped in sub handler { my $db=... ... $db->disconnect(); } So, everything goes out of scope when handler finishes. I made it so to play nice with mod_per. NO globals at all. The apache run two site with such code. One site does not have a problem another builds up the connection. It might be related to windows (it is all under windows and i never had such problem under freebsd). Artem