Re: Idle connection timeout

Lists: pgsql-hackers
From: Thom Brown <thombrown(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Idle connection timeout
Date: 2009-10-09 16:24:54
Message-ID: bddc86150910090924y434dbc52m9e35dc2cedb21075@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

I saw a recent blog entry where someone came up with a solution for expiring
idle connections (
http://dividebyzeroexception.blogspot.com/2009/10/implementing-waittimeout-in-postgresql.html)
and I was surprised there wasn't a config option for this already. Is this
something that can be considered for a future release?

Thanks

Thom


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Thom Brown <thombrown(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Idle connection timeout
Date: 2009-10-09 22:13:21
Message-ID: 200910092213.n99MDLP03099@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Thom Brown wrote:
> I saw a recent blog entry where someone came up with a solution for expiring
> idle connections (
> http://dividebyzeroexception.blogspot.com/2009/10/implementing-waittimeout-in-postgresql.html)
> and I was surprised there wasn't a config option for this already. Is this
> something that can be considered for a future release?

Our TODO has:

Add idle_in_transaction_timeout GUC so locks are not held for
long periods of time

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +


From: Thom Brown <thombrown(at)gmail(dot)com>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Idle connection timeout
Date: 2009-10-09 22:28:42
Message-ID: bddc86150910091528r5cef3c27jb231f0c269d5bc4a@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

2009/10/9 Bruce Momjian <bruce(at)momjian(dot)us>

> Thom Brown wrote:
> > I saw a recent blog entry where someone came up with a solution for
> expiring
> > idle connections (
> >
> http://dividebyzeroexception.blogspot.com/2009/10/implementing-waittimeout-in-postgresql.html
> )
> > and I was surprised there wasn't a config option for this already. Is
> this
> > something that can be considered for a future release?
>
> Our TODO has:
>
> Add idle_in_transaction_timeout GUC so locks are not held for
> long periods of time
>
>
>
Awesome! Thanks for the info Bruce.


From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Thom Brown <thombrown(at)gmail(dot)com>
Cc: Bruce Momjian <bruce(at)momjian(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Idle connection timeout
Date: 2009-10-09 23:34:13
Message-ID: 20091009233413.GH5303@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Thom Brown escribió:
> 2009/10/9 Bruce Momjian <bruce(at)momjian(dot)us>
>
> > Thom Brown wrote:
> > > I saw a recent blog entry where someone came up with a solution
> > > for expiring idle connections (
> > >
> > http://dividebyzeroexception.blogspot.com/2009/10/implementing-waittimeout-in-postgresql.html
> > )
> > > and I was surprised there wasn't a config option for this already.
> > > Is this something that can be considered for a future release?
> >
> > Our TODO has:
> >
> > Add idle_in_transaction_timeout GUC so locks are not held for
> > long periods of time
>
> Awesome! Thanks for the info Bruce.

This is quite a different thing though. You were talking about idle
connections; the TODO item is about idle-in-transaction connections.
(Also, keep in mind that something being in the TODO list does not mean
anyone is planning to work on it.)

--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


From: Thom Brown <thombrown(at)gmail(dot)com>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: Bruce Momjian <bruce(at)momjian(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Idle connection timeout
Date: 2009-10-10 00:51:46
Message-ID: bddc86150910091751o48d14434ld3283286d42defca@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

2009/10/10 Alvaro Herrera <alvherre(at)commandprompt(dot)com>

> > > Our TODO has:
> > >
> > > Add idle_in_transaction_timeout GUC so locks are not held for
> > > long periods of time
> >
> > Awesome! Thanks for the info Bruce.
>
> This is quite a different thing though. You were talking about idle
> connections; the TODO item is about idle-in-transaction connections.
> (Also, keep in mind that something being in the TODO list does not mean
> anyone is planning to work on it.)
>
>
Oh, I see. Yes, that is different. In which case, I'd still like to see
such a feature implemented as I imagine it could be useful for auto-killing
connections not being used that are continuously taking some of the
resources.

Thom


From: Dimitri Fontaine <dfontaine(at)hi-media(dot)com>
To: Thom Brown <thombrown(at)gmail(dot)com>
Cc: Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Bruce Momjian <bruce(at)momjian(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Idle connection timeout
Date: 2009-10-10 12:07:46
Message-ID: m2hbu7cuzx.fsf@hi-media.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Thom Brown <thombrown(at)gmail(dot)com> writes:
> Oh, I see.  Yes, that is different.  In which case, I'd still like to
> see such a feature implemented as I imagine it could be useful for
> auto-killing connections not being used that are continuously taking
> some of the resources.

Did you try pgbouncer yet?
--
dim


From: Thom Brown <thombrown(at)gmail(dot)com>
To: Dimitri Fontaine <dfontaine(at)hi-media(dot)com>
Cc: Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Bruce Momjian <bruce(at)momjian(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Idle connection timeout
Date: 2009-10-10 12:26:54
Message-ID: bddc86150910100526t1f5914b9gdaa8a517551ae1d0@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

2009/10/10 Dimitri Fontaine <dfontaine(at)hi-media(dot)com>

> Thom Brown <thombrown(at)gmail(dot)com> writes:
> > Oh, I see. Yes, that is different. In which case, I'd still like to
> > see such a feature implemented as I imagine it could be useful for
> > auto-killing connections not being used that are continuously taking
> > some of the resources.
>
> Did you try pgbouncer yet?
> --
> dim
>

I've only been using the bare-bones Postgres setup. And you're right,
connection pooling would be a good substitute, so I'll look into setting
that up. Thanks Dimitri.

Thom


From: Tatsuo Ishii <ishii(at)postgresql(dot)org>
To: thombrown(at)gmail(dot)com
Cc: dfontaine(at)hi-media(dot)com, alvherre(at)commandprompt(dot)com, bruce(at)momjian(dot)us, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Idle connection timeout
Date: 2009-10-11 06:25:15
Message-ID: 20091011.152515.74738481.t-ishii@sraoss.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

> > Did you try pgbouncer yet?
> > --
> > dim
> >
>
> I've only been using the bare-bones Postgres setup. And you're right,
> connection pooling would be a good substitute, so I'll look into setting
> that up. Thanks Dimitri.

Pgpool-II has similar functionality too. See client_idle_limit
directive in the pgpool-II configuration file.
--
Tatsuo Ishii
SRA OSS, Inc. Japan