Thread: Idle connection timeout

Idle connection timeout

From
Thom Brown
Date:
I saw a recent blog entry where someone came up with a solution for expiring idle connections (<a
href="http://dividebyzeroexception.blogspot.com/2009/10/implementing-waittimeout-in-postgresql.html">http://dividebyzeroexception.blogspot.com/2009/10/implementing-waittimeout-in-postgresql.html</a>)
andI was surprised there wasn't a config option for this already.  Is this something that can be considered for a
futurerelease?<br /><br />Thanks<br /><br />Thom  

Re: Idle connection timeout

From
Bruce Momjian
Date:
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 forlong periods of time

--  Bruce Momjian  <bruce@momjian.us>        http://momjian.us EnterpriseDB
http://enterprisedb.com
 + If your life is a hard drive, Christ can be your backup. +


Re: Idle connection timeout

From
Thom Brown
Date:


2009/10/9 Bruce Momjian <bruce@momjian.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.

Re: Idle connection timeout

From
Alvaro Herrera
Date:
Thom Brown escribió:
> 2009/10/9 Bruce Momjian <bruce@momjian.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


Re: Idle connection timeout

From
Thom Brown
Date:
2009/10/10 Alvaro Herrera <alvherre@commandprompt.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

Re: Idle connection timeout

From
Dimitri Fontaine
Date:
Thom Brown <thombrown@gmail.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


Re: Idle connection timeout

From
Thom Brown
Date:

2009/10/10 Dimitri Fontaine <dfontaine@hi-media.com>
Thom Brown <thombrown@gmail.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

Re: Idle connection timeout

From
Tatsuo Ishii
Date:
> > 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