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 02:45:12
Message-ID: 97041B7C-5400-41C8-9A9A-13E45699CBD2@hotmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


--
Best regards
Japin Li

On Nov 17, 2020, at 7:59 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 Mon, Nov 16, 2020 at 5:41 AM Li Japin <japinli(at)hotmail(dot)com<mailto:japinli(at)hotmail(dot)com>> wrote:
Thanks for your review! Attached.

Reading the doc changes:

I'd rather not name postgres_fdw explicitly, or at least not solely, as a reason for setting this to zero. Additionally, using postgres_fdw within the server doesn't cause issues, its using postgres_fdw and the remote server having this setting set to zero that causes a problem.

<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.

Text within <para> should be indented one space (you missed both under listitem).

Thanks for your suggest! How about change document as follows:

diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml
index 6c4e2a1fdc..23e691a7c5 100644
--- a/doc/src/sgml/config.sgml
+++ b/doc/src/sgml/config.sgml
@@ -8281,17 +8281,17 @@ COPY postgres_log FROM '/full/path/to/logfile.csv' WITH csv;
</term>
<listitem>
<para>
- Terminate any session that has been idle for longer than the specified amount of time.
+ Terminate any session that has been idle for longer than the specified amount of time.
</para>
<para>
- If this value is specified without units, it is taken as milliseconds.
- A value of zero (the default) disables the timeout.
+ If this value is specified without units, it is taken as milliseconds.
+ A value of zero (the default) disables the timeout.
</para>

<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>

I'd suggest a comment that aside from a bit of resource consumption idle sessions do not interfere with the long-running stability of the server, unlike idle-in-transaction sessions which are controlled by the other configuration setting.

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

--
Best regards
Japin Li

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Fujii Masao 2020-11-17 02:46:33 Re: Add statistics to pg_stat_wal view for wal related parameter tuning
Previous Message Tom Lane 2020-11-17 02:14:51 Re: Tab complete for CREATE OR REPLACE TRIGGER statement