pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: mike g <mike@thegodshalls.com>
To: Konstantin Pelepelin <checat@pochtamt.ru>
Cc: pgsql-admin@postgresql.org
Subject: Re: are there ways for 'idle timeout'?
Date: Fri, 09 Jul 2004 22:29:11 -0500
Message-ID: <1089430151.10763.17.camel@localhost.localdomain> (raw)
In-Reply-To: <opsavj6izuhocrah@cathost.of.dtf.ru>
References: <opsavj6izuhocrah@cathost.of.dtf.ru>

The best solution would be to fix the web app but....

Could you set the deadlock_timeout in postgresql.conf?  According to
documentation that will kill one of the transactions that has issued the
lock on the table or row?


On Fri, 2004-07-09 at 09:36, Konstantin Pelepelin wrote:
> Hi!
> 
> In situations where client application is unstable there is very big  
> chance that it will enter transaction, acquire very restrictive locks and  
> then hang. This means: connection is not lost, but nothing happens and any  
> transaction in conflict with those locks will hang too.
> statement_timeout can help to detect this situation, but not to solve,  
> when most of applications fail. Currently the only way I see to solve is  
> to kill locked postgres backend, or (more difficult) find hanging client  
> among hundreds of similar.
> I work with web-application (Apache-mod_php-Postgres), where PHP hangs  
> every 100000 requests or so, which means from a day to some weeks between  
> whole system hangs.
> I could set up a cron job which will kill every postgres backend "idle in  
> transaction" which was started more than 10 minutes ago, but I can have  
> accident problems with some long-running tasks.
> The best solution I see is having an (per session)  
> idle_transaction_timeout or idle_connection_timeout setting.
> But there is no such thing in postgres!
> Scanning through list I've not found any workaround.
> Looking into TODO I don't see any plans for it.
> Is it too difficult implementing or I've missed something or are there  
> workarounds?
> 
> Hoping on your responce,
> Konstantin Pelepelin
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 9: the planner will ignore your desire to choose an index scan if your
>       joining column's datatypes do not match



view thread (5+ messages)  latest in thread

Message-ID: <1089430151.10763.17.camel@localhost.localdomain>
Permalink:  ../1089430151.10763.17.camel@localhost.localdomain/
Also on:    postgresql.org/message-id/1089430151.10763.17.camel@localhost.localdomain

 · 

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: mike@thegodshalls.com, checat@pochtamt.ru
  Subject: Re: are there ways for 'idle timeout'?
  In-Reply-To: <1089430151.10763.17.camel@localhost.localdomain>
  References: <opsavj6izuhocrah@cathost.of.dtf.ru> <1089430151.10763.17.camel@localhost.localdomain>

* 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