X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 2EC4811F65FA for ; Wed, 29 Mar 2006 12:02:54 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 51481-01 for ; Wed, 29 Mar 2006 12:02:49 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from nproxy.gmail.com (nproxy.gmail.com [64.233.182.186]) by postgresql.org (Postfix) with ESMTP id 8F5D511F65E9 for ; Wed, 29 Mar 2006 12:02:48 -0400 (AST) Received: by nproxy.gmail.com with SMTP id g2so159008nfe for ; Wed, 29 Mar 2006 08:02:47 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=teQhd3rC4KuafNtokmV/ND5HbTEgyXRth/gxRe8F/bGkBIo8d7HvLd6vCKTiXZu/8VxZ+4UJkW8zUDgPD5WLhNHKLUqSNfd7oS2FJ4ulM1QYAUS1FBxPgckuNJBPtNvu91tLHdNu3OtDrGYGuQZRnoBArEFyFeA8+5Q7OAavJQ8= Received: by 10.49.10.19 with SMTP id n19mr392740nfi; Wed, 29 Mar 2006 08:02:47 -0800 (PST) Received: by 10.49.26.20 with HTTP; Wed, 29 Mar 2006 08:02:47 -0800 (PST) Message-ID: Date: Wed, 29 Mar 2006 21:32:47 +0530 From: "Rajesh Kumar Mallah" To: "Salem Berhanu" Subject: Re: postgres and persistant connections (using Apache::DBI) Cc: pgsql-admin@postgresql.org In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=1.323 required=5 tests=[AWL=-0.009, RCVD_IN_BL_SPAMCOP_NET=1.332] X-Spam-Score: 1.323 X-Spam-Level: * X-Archive-Number: 200603/342 X-Sequence-Number: 21099 On 3/29/06, Salem Berhanu wrote: > I am trying to set up a persistent connection to a handful of postgres db= s > at startup using Apache::DBI (also using mod_perl) > Here is what I am doing but I am not sure how to check if it's working > right. > > in httpd.conf I have > PerlRequire startup.pl > > in startup.pl I load all the necessary perl modules and also include the > lines > > use Apache::DBI; > Apache::DBI->connect_on_init( host, login, password); > > This doesn't seem to make any difference. I was expecting to see database > connections when I restarted apache and that all queries would get handle= d > by these connections. Is this a wrong assumption? What is the expectation > and what would be a good test when setting up persistent connections to a > postgres db? We use DBI connection pooling with postgres in mod_perl environment and it works fine. We however do not use connect_on_init as Apache::DBI docs say that all DBI->connect() anyway gets intercepted transparently. please take care that 1. Make sure Apache::DBI is loaded before any module that issues a DB conne= ct. you can even load Apache::DBI from httpd.conf by PerlRequire Apache::DBI 2. You can know if Apache::DBI is effective or not by installing Apache::St= atus ,load Apache::Status before Apache::DBI in that case and add a Location section in the httpd.conf like: --------------- httpd.conf--------------------- PerlModule Apache::Status PerlModule Apache::DBI SetHandler perl-script PerlHandler Apache::Status ------------------------------------------------------ point your browser to http://your_mod_perl_server/perl-status and check the section about database conenctions. i am not sure if this info answers your question but i am describing something that works for me. regds Rajesh Kumar Mallah. > Thanks much > Salem > > > > ---------------------------(end of broadcast)--------------------------- > TIP 2: Don't 'kill -9' the postmaster >