Re: Connections - Postgres 9.2 - Mailing list pgsql-general

From Sridhar N Bamandlapally
Subject Re: Connections - Postgres 9.2
Date
Msg-id CAGuFTBVjSdrGK=OO1OoPYQhQA59MPPk57rYK488S7LzNCawT9A@mail.gmail.com
Whole thread Raw
In response to Re: Connections - Postgres 9.2  ("David G. Johnston" <david.g.johnston@gmail.com>)
Responses Re: Connections - Postgres 9.2  (Lucas Possamai <drum.lucas@gmail.com>)
List pgsql-general
Hi

I control this way

if "state_change" is from longtime and "state" is idle then I use

function:
  pg_terminate_backend ( integer )  ==> return TRUE if killed-successful else FALSE

example:
# select pg_terminate_backend ( pid ) from pg_stat_activity where state='idle' and state_change < (current_timestamp - interval '1 hour');

may be helpful

NOTE: we come to decision to kill sessions in idle state more then "1 hour" after lot of discussion with application / implementation / stake-holders team

*removed history as thrown error due to mail length


Thanks
Sridhar 
OpenText


pgsql-general by date:

Previous
From: Bráulio Bhavamitra
Date:
Subject: Re: Columnar store as default for PostgreSQL 10?
Next
From: Kevin Grittner
Date:
Subject: Re: Increased I/O / Writes