Doc: enhance the description on connection_life_time
authorTatsuo Ishii <ishii@postgresql.org>
Thu, 24 Apr 2025 10:11:43 +0000 (19:11 +0900)
committerTatsuo Ishii <ishii@postgresql.org>
Thu, 24 Apr 2025 10:11:43 +0000 (19:11 +0900)
connection_life_time is a config value to determine the life time of
cached connections to PostgreSQL backend. Current document lacks a
description that the expiration calculation is actually done at the
time when the client disconnects to the process which holds the cached
connections.

Discussion: [pgpool-hackers: 4577] Doc: enhance the description on connection_life_time
https://www.pgpool.net/pipermail/pgpool-hackers/2025-April/004578.html
Backpatch-through: v4.2

doc.ja/src/sgml/connection-pooling.sgml
doc/src/sgml/connection-pooling.sgml

index 3335e85aec9bd55b2e3390986a7980305ae8d5d4..7f50d56791f6804086970064eb460a692ef3fe9b 100644 (file)
@@ -444,6 +444,11 @@ pgbench -n -S -p 9999 -c 32 -C -S -T 300 test
       キャッシュされた<productname>PostgreSQL</>への接続を切断するまでの時間を秒単位で指定します。
       これはキャッシュされた接続の有効期間として働きます。
      </para>
+     <para>
+      このキャッシュを保持するプロセスに接続中のクライアントがある場合は、その接続が終了するまで<varname>connection_life_time</varname>の有効期間が来たかどうかの計算は行われません。
+      したがって、このパラメータの設定値よりも長時間キャッシュされたコネクションが保持されることがあり得ます。
+      これを避けたい場合は、<xref linkend="guc-client-idle-limit">を短めに設定することをお勧めします。
+     </para>
      <para>
       <!--
       The default is 0, which means the cached connections will not be disconnected.
index daa84c3f73e4a8ec71fc636218829c3c960d1aae..3301bd4a9f0a65f849bec28f605fbdd0a46c396e 100644 (file)
     <listitem>
      <para>
       Specifies the time in seconds to terminate the cached connections
-      to the PostgreSQL backend. This serves as the cached connection expiration time.
+      to the <productname>PostgreSQL</> backend. This serves as the cached connection expiration time.
      </para>
      <para>
-      The default is 0, which means the cached connections will not be disconnected.
+      If a client connects to the process which holds the cached
+      connections, a calculation on
+      the <varname>connection_life_time</varname> is not performed
+      until the client disconnects. Thus it is possible that the cached
+      connections are kept for longer time than this value. To avoid
+      this, it is recommended to set shorter value
+      to <xref linkend="guc-client-idle-limit">.
+     </para>
+     <para>
+      The default is 0, which means the cached connections will not be
+      disconnected.
      </para>
      <para>
       This parameter can only be set at server start.