Re: Terminate the idle sessions

From: Li Japin <japinli(at)hotmail(dot)com>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: "kuroda(dot)hayato(at)fujitsu(dot)com" <kuroda(dot)hayato(at)fujitsu(dot)com>, Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>, Thomas Munro <thomas(dot)munro(at)gmail(dot)com>, "bharath(dot)rupireddyforpostgres(at)gmail(dot)com" <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>, "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Terminate the idle sessions
Date: 2020-11-17 03:27:05
Message-ID: 2F900B6E-5F2C-4D38-AA50-00E2C6C0FD46@hotmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On Nov 17, 2020, at 10:53 AM, David G. Johnston <david(dot)g(dot)johnston(at)gmail(dot)com<mailto:david(dot)g(dot)johnston(at)gmail(dot)com>> wrote:

On Monday, November 16, 2020, Li Japin <japinli(at)hotmail(dot)com<mailto:japinli(at)hotmail(dot)com>> wrote:

<note>
Consider setting this for specific users instead of as a server default. Client connections managed by connection poolers, or initiated indirectly like those by a remote postgres_fdw using server, should probably be excluded from this timeout.

<note>
<para>
- This parameter should be set to zero if you use postgres_fdw or some
- connection-pooling software, because connections might be closed unexpectedly.
+ This parameter should be set to zero if you use some connection-pooling software, or
+ PostgreSQL servers used by postgres_fdw, because connections might be closed unexpectedly.
</para>
</note>

Prefer mine, “or pg servers used by postgres_fdw”, doesn’t flow.

Could you please explain how the idle-in-transaction interfere the long-running stability?

From the docs (next section):

This allows any locks held by that session to be released and the connection slot to be reused; it also allows tuples visible only to this transaction to be vacuumed. See Section 24.1<https://www.postgresql.org/docs/13/routine-vacuuming.html> for more details about this.

Thanks David! Attached.

--
Best regards
Japin Li

Attachment Content-Type Size
v6-0001-Allow-terminating-the-idle-sessions.patch application/octet-stream 10.1 KB
v6-0002-Optimize-setitimer-usage.patch application/octet-stream 3.8 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message lchch1990@sina.cn 2020-11-17 03:53:37 Re: Add statistics to pg_stat_wal view for wal related parameter tuning
Previous Message Tom Lane 2020-11-17 03:14:10 Re: Tab complete for CREATE OR REPLACE TRIGGER statement