Re: Connections - Postgres 9.2

From: Sridhar N Bamandlapally <sridhar(dot)bn1(at)gmail(dot)com>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: Lucas Possamai <drum(dot)lucas(at)gmail(dot)com>, Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Connections - Postgres 9.2
Date: 2016-05-17 10:24:17
Message-ID: CAGuFTBVjSdrGK=OO1OoPYQhQA59MPPk57rYK488S7LzNCawT9A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Kevin Grittner 2016-05-17 11:30:14 Re: Increased I/O / Writes
Previous Message Sridhar N Bamandlapally 2016-05-17 10:16:12 Re: Connections - Postgres 9.2