Re: Feature thought: idle in transaction timeout

From: Hannu Krosing <hannu(at)skype(dot)net>
To: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Bruce Momjian <bruce(at)momjian(dot)us>, Russell Smith <mr-russ(at)pws(dot)com(dot)au>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Feature thought: idle in transaction timeout
Date: 2007-04-03 06:34:02
Message-ID: 1175582042.3859.15.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Ühel kenal päeval, E, 2007-04-02 kell 19:36, kirjutas Joshua D. Drake:
> Tom Lane wrote:
> > "Joshua D. Drake" <jd(at)commandprompt(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2007-04-03 07:20:08 Re: Calling void functions
Previous Message Tom Lane 2007-04-03 06:30:07 Re: [HACKERS] Arrays of Complex Types