Re: Feature thought: idle in transaction timeout - Mailing list pgsql-hackers

From Hannu Krosing
Subject Re: Feature thought: idle in transaction timeout
Date
Msg-id 1175582042.3859.15.camel@localhost.localdomain
Whole thread Raw
In response to Re: Feature thought: idle in transaction timeout  ("Joshua D. Drake" <jd@commandprompt.com>)
List pgsql-hackers
Ühel kenal päeval, E, 2007-04-02 kell 19:36, kirjutas Joshua D. Drake:
> Tom Lane wrote:
> > "Joshua D. Drake" <jd@commandprompt.com> writes:
> >> Bruce Momjian wrote:
> >>> Added to TODO:
> >>> * Add idle_timeout GUC so locks are not held for log periods of time
> > 
> >> That should actually be transaction_idle_timeout. It is o.k. for us to 
> >> be IDLE... it is not o.k. for us to be IDLE in Transaction
> > 
> > Or "idle_in_transaction_timeout"?
> 
> Yeah that would work and it is what I originally typed before 
> backspacing. I was trying to avoid the _in_  but either way.
> 
> >  Anyway I agree that using
> > "idle_timeout" for this is unwise.  We've been asked often enough for a
> > flat-out idle timeout (ie kill session after X seconds of no client
> > interaction), and while I disagree with the concept, someday we might
> 
> Well I agree that we shouldn't kill sessions just because they are idle, 

As the projects to have some out-of-band capabilities in pg wire
protocol which could be used to implement keepalives seem to be going
nowhere, having an idle_session_timeout to have a at least some
protection against server not noticing that client has left (due to
network problems for example) may still be a good thing. 

At least it beats running

psql -c "select 'kill '||procpid from pg_stat_activity where
current_query = '<IDLE>' and current_timestamp - query_start  >
'00:01:00';" | bash

from postgres users cron each minute to kill stale connections

idle_session_timeout is something that should be off by default and
would be used only in OLTP production environments where not noticing
stale connections can lead to exhausting connection pool by reconnecting
clients.

> I can imagine all the lovely... my pgpool sessions keep getting killed! 
> comments.

pgpool could do 'select 1' often enough to keep timeout from happening;

> > cave and implement it.  We should reserve the name for the behavior
> > that people would expect a parameter named like that to have.
> 
> Agreed.
> 
> Sincerely,
> 
> Joshua D. Drake
> 
> > 
> >             regards, tom lane
> > 
> 
> 
-- 
----------------
Hannu Krosing
Database Architect
Skype Technologies OÜ
Akadeemia tee 21 F, Tallinn, 12618, Estonia

Skype me:  callto:hkrosing
Get Skype for free:  http://www.skype.com




pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [PATCHES] Arrays of Complex Types
Next
From: "Pavel Stehule"
Date:
Subject: Re: Calling void functions