Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id AA73A475EE2 for ; Fri, 4 Oct 2002 15:06:51 -0400 (EDT) Received: from mail.libertyrms.com (unknown [209.167.124.227]) by postgresql.org (Postfix) with ESMTP id 099DD475D20 for ; Fri, 4 Oct 2002 15:06:51 -0400 (EDT) Received: from andrew by mail.libertyrms.com with local (Exim 3.22 #3 (Debian)) id 17xXml-0006Gq-00 for ; Fri, 04 Oct 2002 15:06:51 -0400 Date: Fri, 4 Oct 2002 15:06:51 -0400 From: Andrew Sullivan To: pgsql-admin@postgresql.org Subject: Re: idle in transaction with mod_perl Message-ID: <20021004150651.Q949@mail.libertyrms.com> Mail-Followup-To: Andrew Sullivan , pgsql-admin@postgresql.org References: <200209300303.g8U333D28908@minos.iwerx.gr> <57630.203.145.129.3.1033742077.squirrel@mail.trade-india.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <57630.203.145.129.3.1033742077.squirrel@mail.trade-india.com>; from mallah@trade-india.com on Fri, Oct 04, 2002 at 08:04:37PM +0530 X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200210/31 X-Sequence-Number: 5889 On Fri, Oct 04, 2002 at 08:04:37PM +0530, mallah@trade-india.com wrote: > I too use mod_perl + postgresql > its perfectly ok to have "idle in transaction..." Well, not really. But it's probably normal. See below. > the persistant connections makes all the difference. For some reason, most of the persistent connection/pooling/auto-commit=off approaches in PostgreSQL issue a BEGIN as soon as a transaction ends. The problem with this is that several maintenance types of things -- VACUUM FULL being the most obvious -- will conflict with these kinds of transactions. If you happen to have a connection that stays idle this way for a long time, it can cause you some little bits of grief (like by not reclaiming as much disk as it otherwise would, or not recycling as much in a non-blocking VACUUM, or other similar things). The real answer is to change the connection pooling &c. But since that's not likely to happen in a lot of cases, you should just make sure that you don't perpetually leave around idle connections. A -- ---- Andrew Sullivan 204-4141 Yonge Street Liberty RMS Toronto, Ontario Canada M2P 2A8 +1 416 646 3304 x110