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:16:07 +0000 (19:16 +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 1aa7a856bf1cfc9c3fd6a2b818dd95bb9fc28b6f..cd8c13080f1a02d0fa7a35908f248d5314cd2606 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 4a1a47776bc5b18080349dbde2ded68dfb14ad9c..170a0b060b8cfb56f69ce936b0122e112d75d97f 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.