pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrew Sullivan <andrew@libertyrms.info>
To: pgsql-admin@postgresql.org
Subject: Re: idle in transaction with mod_perl
Date: Fri, 4 Oct 2002 15:06:51 -0400
Message-ID: <20021004150651.Q949@mail.libertyrms.com> (raw)
In-Reply-To: <57630.203.145.129.3.1033742077.squirrel@mail.trade-india.com>
References: <200209300303.g8U333D28908@minos.iwerx.gr>
	<57630.203.145.129.3.1033742077.squirrel@mail.trade-india.com>

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
<andrew@libertyrms.info>                              M2P 2A8
                                         +1 416 646 3304 x110




view thread (3+ messages)

Message-ID: <20021004150651.Q949@mail.libertyrms.com>
Permalink:  ../20021004150651.Q949@mail.libertyrms.com/
Also on:    postgresql.org/message-id/20021004150651.Q949@mail.libertyrms.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: andrew@libertyrms.info
  Subject: Re: idle in transaction with mod_perl
  In-Reply-To: <20021004150651.Q949@mail.libertyrms.com>
  References: <200209300303.g8U333D28908@minos.iwerx.gr> <57630.203.145.129.3.1033742077.squirrel@mail.trade-india.com> <20021004150651.Q949@mail.libertyrms.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox