Re: Session Identifiers

From: oleg yusim <olegyusim(at)gmail(dot)com>
To: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Cc: Stephen Frost <sfrost(at)snowman(dot)net>, Melvin Davidson <melvin6925(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Session Identifiers
Date: 2015-12-22 18:49:55
Message-ID: CAKd4e_G6+jJGMzhzCJ_5PaEUkbSF2NWfUr6Gc1+bkByCurxFeg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Thanks Michael, you are right, that is a very good alternative solution.

Oleg

On Tue, Dec 22, 2015 at 6:27 AM, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
wrote:

> On Tue, Dec 22, 2015 at 1:42 AM, Stephen Frost <sfrost(at)snowman(dot)net> wrote:
> > Oleg,
> >
> > * oleg yusim (olegyusim(at)gmail(dot)com) wrote:
> >> tcp_keepalives_idle = 900
> >> tcp_keepalives_interval=0
> >> tcp_keepalives_count=0
> >>
> >> Doesn't terminate connection to database in 15 minutes of inactivity of
> >> psql prompt. So, it looks like that would work only for case if network
> >> connection is broken and session left hanging. For psql prompt case
> looks
> >> like pg_terminate_backend() would be the only solution.
> >
> > Those settings aren't for controlling idle timeout of a connection.
> >
> > pg_terminate_backend() will work and could be run out of a cronjob.
>
> Or a background worker if you are using PG >= 9.3:
> https://github.com/michaelpq/pg_plugins/tree/master/kill_idle
> This has the advantage to not have the cronjob error out should the
> server be stopped. That's less error handling to take care of at
> frontend level.
> --
> Michael
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Melvin Davidson 2015-12-22 19:31:26 Re: Table with seemingly duplicated primary key values
Previous Message Bill Moran 2015-12-22 17:40:18 Re: uuid-ossp: Performance considerations for different UUID approaches?