Skip site navigation (1) Skip section navigation (2)

Re: i can't connect after some periode

From: "Scott Marlowe" <scott(dot)marlowe(at)gmail(dot)com>
To: lennin(dot)caro(at)yahoo(dot)com
Cc: pgsql-sql(at)postgresql(dot)org, aldy <aldy(at)teodore(dot)com>
Subject: Re: i can't connect after some periode
Date: 2008-07-10 14:48:20
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-sql
On Thu, Jul 10, 2008 at 8:22 AM, Lennin Caro <lennin(dot)caro(at)yahoo(dot)com> wrote:
> --- On Thu, 7/10/08, aldy <aldy(at)teodore(dot)com> wrote:
>> From: aldy <aldy(at)teodore(dot)com>
>> Subject: Re: [SQL] i can't connect after some periode
>> To: pgsql-sql(at)postgresql(dot)org
>> Date: Thursday, July 10, 2008, 8:16 AM
>> From: "A. Kretschmer"
>> <andreas(dot)kretschmer(at)schollglas(dot)com>
>> Sent: Thursday, July 10, 2008 14:14
>> >First, don't hijack other threads, your mail
>> contains a
>> >References-header:
>> owkay, i'm sorry for that
>> > Maybe the clients do not close the connection and
>> after some time you
>> > have more than 'max_connections' (Default
>> 100).
>> >
>> > You can increase this value in your postgresql.conf.
>> >
>> >
>> > You can also check, how many active connections are
>> open with 'select *
>> > from pg_stat_activity'.
>> >
>> >
>> > Hope that helps, Andreas
>> thanks for the answer,
>> is there any procedure(utility) or configuration in
>> postgresql which can
>> auto close for connection that idle for some minutes
> config parameters in postgres.conf
> tcp_keepalives_idle (integer)
> tcp_keepalives_interval (integer)
> tcp_keepalives_count (integer)

Note that if the client is still up and running, then this will not
close the connection.   However, if a firewall between client and
server is dropping idle connections then this will harvest them.

There is no built in functionality to disconnect idle connections that
are still alive.  You'd have to write some sort of shell script to
find them and send them a SIGTERM signal (is that the right signal?  I
always forget which signal is the right one.  Could be SIGHUP or

A better option might be to look into pgpool, which can allow you to
keep your db connections down while having a large number of fairly
cheap connections kept open on the client side.

In response to

pgsql-sql by date

Next:From: Chris PrestonDate: 2008-07-10 15:40:17
Subject: Converting Copy to insert statement in backup file
Previous:From: Lennin CaroDate: 2008-07-10 14:22:41
Subject: Re: i can't connect after some periode

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group