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:16:12
Message-ID: CAGuFTBWynm4pz6EAFV1XSwr-z__DnqAFJ5YOhUG1THa72qoWZA@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

Thanks
Sridhar
OpenText

On Mon, May 16, 2016 at 9:57 PM, David G. Johnston <
david(dot)g(dot)johnston(at)gmail(dot)com> wrote:

> On Sun, May 15, 2016 at 10:10 PM, Lucas Possamai <drum(dot)lucas(at)gmail(dot)com>
> wrote:
>
>> Hi guys,
>>
>> [image: Inline images 1]
>>
>> Those IDLE connections, might be because the user/application didn't
>> commit the transaction?
>>
>
> ​No, that is what the yellow-ish "Idle in transaction" would indicate.
>
> Idle is simply remote clients actively logged into the server but not
> doing anything.
>
> David J.
> ​
>
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Sridhar N Bamandlapally 2016-05-17 10:24:17 Re: Connections - Postgres 9.2
Previous Message Bráulio Bhavamitra 2016-05-17 10:14:09 Re: Columnar store as default for PostgreSQL 10?