Add new fields to pcp_proc_info, show pool_processes, show pool_pools command.
authorMasaya Kawamoto <kawamoto@sraoss.co.jp>
Wed, 8 Sep 2021 06:46:31 +0000 (06:46 +0000)
committerMasaya Kawamoto <kawamoto@sraoss.co.jp>
Wed, 8 Sep 2021 06:46:31 +0000 (06:46 +0000)
The purpose of this commit is to get more information about the process stats
and how pgpool is working with "client_idle_limit" and "child_max_connections".

Start time:
I add “remaining” that is the remaining time beforl the process is restarted by
client_idle_limit.

Client connection count:
The connection count from clients to this pgpool process. Useful to know how
many times clients can connect to this pgpool process before
child_max_connections reaches.

Backend connection time:
I just rename create_time for clarity.

Client connection time:
The time when the client last connected. If the client uses its own connection
pooling, this helps to know when the connection was actually made from pgpool's
point of view.

Client idle duration:
The elapsed time (in seconds) since the client became in idle state.

Client disconnection time:
This is the last time the client disconnects. The use case is the same as above.

Status:
This is the process status. This shows 4 status: “Wait for connections”, “Idle”,
“Idle in transaction”, “Execute command”.

17 files changed:
doc.ja/src/sgml/ref/pcp_proc_info.sgml
doc.ja/src/sgml/ref/show_pool_pools.sgml
doc.ja/src/sgml/ref/show_pool_processes.sgml
doc/src/sgml/ref/pcp_proc_info.sgml
doc/src/sgml/ref/show_pool_pools.sgml
doc/src/sgml/ref/show_pool_processes.sgml
src/context/pool_process_context.c
src/include/pcp/libpcp_ext.h
src/include/pool.h
src/main/pgpool_main.c
src/protocol/child.c
src/protocol/pool_connection_pool.c
src/protocol/pool_process_query.c
src/tools/pcp/pcp_frontend_client.c
src/utils/pool_health_check_stats.c
src/utils/pool_process_reporting.c
src/utils/ps_status.c

index 9d4ff93b44a327424feff9e3f4c4e1b82a5cce7d..ad951934475b44b0fd4a6cb42c757785dee6c48a 100644 (file)
@@ -118,9 +118,9 @@ Pgpool-II documentation
    -->
    例を示します。
    <programlisting>
-    $ pcp_proc_info -p 11001 1406
-    test t-ishii 2018-07-09 16:43:53 2018-07-09 16:44:08 3 0 1 1435 1 1406 0
-    test t-ishii 2018-07-09 16:43:53 2018-07-09 16:44:08 3 0 1 1436 1 1406 1
+$ pcp_proc_info -p 11001 2871
+postgres postgres 2021-09-07 02:12:53 (remaining: 0:27) 1 3 0 2021-09-07 02:16:59 2021-09-07 02:16:59 273 2021-09-07 02:16:56 1 3016 1 2871 0 Idle
+postgres postgres 2021-09-07 02:12:53 (remaining: 0:27) 1 3 0 2021-09-07 02:16:59 2021-09-07 02:16:59 0 2021-09-07 02:16:56 1 3017 1 2871 1 Idle
    </programlisting>
   </para>
   <para>
@@ -132,27 +132,37 @@ Pgpool-II documentation
     <!--
     1. connected database name
     2. connected user name
-    3. process start-up timestamp
-    4. connection created timestamp
+    3. process start-up timestamp (remaining time by <xref linkend="guc-client-idle-limit">. If client_idle_limit is set 0, remaining is not desplayed.)
+    4. process-reuse counter for <xref linkend="guc-child-max-connections">
     5. protocol major version
     6. protocol minor version
-    7. connection-reuse counter
-    8. PostgreSQL backend process id
-    9. 1 if frontend conncted 0 if not
-    10. pgpool child process id
-    11. PostgreSQL backend id 
+    7. connection created timestamp
+    8. last client connected timestamp
+    9. client idle duration (sec) for <xref linkend="guc-client-idle-limit">
+    10. last client disconnected timestamp
+    11. connection-reuse counter
+    12. PostgreSQL backend process id
+    13. 1 if frontend connected 0 if not
+    14. pgpool child process id
+    15. PostgreSQL backend id
+    16. process status
     -->
     1. 接続先のデータベース名
     2. 接続先のユーザ名
-    3. Pgpool-IIプロセスの起動時刻
-    4. ã\83\90ã\83\83ã\82¯ã\82¨ã\83³ã\83\89ã\81¸ã\81®æ\8e¥ç¶\9aæ\99\82å\88»
+    3. Pgpool-IIプロセスの起動時刻 (<xref linkend="guc-client-idle-limit">による残り時間。client_idle_limitが0の場合、remainingは表示されません)
+    4. ã\83\97ã\83­ã\82»ã\82¹ã\81®å\88©ç\94¨ã\82«ã\82¦ã\83³ã\82¿(<xref linkend="guc-child-max-connections">ã\82\92å\8f\82ç\85§)
     5. プロトコルのメジャーバージョン
     6. プロトコルのマイナーバージョン
-    7. 接続の再利用カウンタ値
-    8. PostgreSQLバックエンドプロセスのプロセスID
-    9. フロントエンドが接続中なら1、そうでなければ0
-    10. pgpool子プロセスID
-    11. PostgreSQLバックエンドID
+    7. バックエンドへの接続時刻
+    8. クライアントが最後に接続開始した時刻
+    9. 接続がidleとなっている時間(秒)(<xref linkend="guc-client-idle-limit">を参照)
+    10. クライアントが最後に接続終了した時刻
+    11. 接続の再利用カウンタ値
+    12. PostgreSQLバックエンドプロセスのプロセスID
+    13. フロントエンドが接続中なら1、そうでなければ0
+    14. pgpool子プロセスID
+    15. PostgreSQLバックエンドID
+    16. プロセスの状態
    </literallayout>
   </para>
   <para>
@@ -171,29 +181,40 @@ Pgpool-II documentation
    <option>--verbose</option> オプションは出力内容を理解するのに役に立ちます。例:
   </para>
   <programlisting>
-   $ pcp_proc_info -p 11001 --verbose 1406
-   Database     : test
-   Username     : t-ishii
-   Start time   : 2018-07-09 16:43:53
-   Creation time: 2018-07-09 16:44:08
-   Major        : 3
-   Minor        : 0
-   Counter      : 1
-   Backend PID  : 1435
-   Connected    : 1
-   PID          : 1406
-   Backend ID   : 0
-   Database     : test
-   Username     : t-ishii
-   Start time   : 2018-07-09 16:43:53
-   Creation time: 2018-07-09 16:44:08
-   Major        : 3
-   Minor        : 0
-   Counter      : 1
-   Backend PID  : 1436
-   Connected    : 1
-   PID          : 1406
-   Backend ID   : 1
+$ pcp_proc_info -p 11001 --verbose 2871
+Database                  : postgres
+Username                  : postgres
+Start time                : 2021-09-07 02:12:53 (remaining: 3:36)
+Client connection count   : 1
+Major                     : 3
+Minor                     : 0
+Backend connection time   : 2021-09-07 02:16:59
+Client connection time    : 2021-09-07 02:16:59
+Client idle duration      : 84
+Client disconnection time : 2021-09-07 02:16:56
+Pool Counter              : 1
+Backend PID               : 3016
+Connected                 : 1
+PID                       : 2871
+Backend ID                : 0
+Status                    : Idle
+
+Database                  : postgres
+Username                  : postgres
+Start time                : 2021-09-07 02:12:53 (remaining: 3:36)
+Client connection count   : 1
+Major                     : 3
+Minor                     : 0
+Backend connection time   : 2021-09-07 02:16:59
+Client connection time    : 2021-09-07 02:16:59
+Client idle duration      : 0
+Client disconnection time : 2021-09-07 02:16:56
+Pool Counter              : 1
+Backend PID               : 3017
+Connected                 : 1
+PID                       : 2871
+Backend ID                : 1
+Status                    : Idle
   </programlisting>
  </refsect1>
 
index 226f6cf2f200dbfdd7bab201d8e8348c1d27621e..8ae7e568a7ff08a48a125f6a75e24161d883489c 100644 (file)
@@ -38,7 +38,7 @@
   <title>説明</title>
 
   <para>
-   <command>SHOW pool_pools</command>
+   <command>SHOW POOL_POOLS</command>
    <!--
    sends back a list of pools handled by <productname>Pgpool-II</productname>
    -->
@@ -46,9 +46,9 @@
   </para>
   <para>
    <!--
-   It has 12 columns:
+   It has 17 columns:
    -->
-   12のカラムがあります。
+   17のカラムがあります。
    <itemizedlist>
     <listitem>
      <para>
       <literal>start_time</literal> is the timestamp of when
       this process was launched.
       -->
-      <literal>start_time</literal> はこのプロセスが起動された時刻です (1970年1月1日からの経過秒で表示されます)。
+      <literal>start_time</literal> はこのプロセスが起動された時刻です。
+      <itemizedlist>
+       <listitem>
+        <para>
+         <!--
+         <literal>remaining</literal> is the remaining time by
+         <xref linkend="guc-client-idle-limit">. If
+         <literal>client_idle_limit</literal> is set 0,
+         <literal>remaining</literal> is not desplayed.
+         -->
+         <literal>remaining</literal> は <xref linkend="guc-client-idle-limit"> に
+         よる残り時間です。<literal>client_idle_limit</literal> が 0 の場合、
+         <literal>remaining</literal> は表示されません。
+        </para>
+       </listitem>
+      </itemizedlist>
+     </para>
+    </listitem>
+
+    <listitem>
+     <para>
+     <!--
+      <literal>client_connection_count</literal> counts the number of times
+      this process has been used by clients.
+      -->
+      <literal>client_connection_count</literal> はこのプロセスが使用された回数です。
      </para>
     </listitem>
 
     <listitem>
      <para>
       <!--
-      <literal>create_time</literal> is the creation time and
+      <literal>backend_connection_time</literal> is the creation time and
       date of the connection.
       -->
-      <literal>create_time</literal> はこの接続が作成された時刻です。
+      <literal>backend_connection_time</literal> はこの接続が作成された時刻です。
+     </para>
+    </listitem>
+
+    <listitem>
+     <para>
+      <!--
+      <literal>client_connection_time</literal> is the date when a client
+      last used this connection.
+      -->
+      <literal>client_connection_time</literal> は最後にクライアントが接続した時刻です。
+     </para>
+    </listitem>
+
+    <listitem>
+     <para>
+      <!--
+      <literal>client_disconnection_time</literal> is the date when a client
+      last disconnected from this connection.
+      -->
+      <literal>client_disconnection_time</literal> は最後にクライアントが切断した時刻です。
+     </para>
+    </listitem>
+
+    <listitem>
+     <para>
+      <!--
+      <literal>client_idle_duration</literal> is the time (sec) that a client
+      is in idle.
+      -->
+      <literal>client_idle_duration</literal> はクライアントからのコマンドを待機している時間(秒)です。
      </para>
     </listitem>
 
      </para>
     </listitem>
 
+    <listitem>
+     <para>
+      <!--
+      <literal>status</literal> is current status of this process. Possible values are:
+      -->
+      <literal>status</literal> は現在のプロセスの状態です。以下のいずれかの値を取ります:
+        <itemizedlist>
+          <listitem>
+            <para>
+              <!--
+              <literal>Execute command</literal>: Executing a command.
+              -->
+              <literal>Execute command</literal>: コマンドを実行中です。
+            </para>
+          </listitem>
+          <listitem>
+            <para>
+              <!--
+              <literal>Idle</literal>: The process is waiting for a new client command.
+              -->
+              <literal>Idle</literal>: クライアントからのコマンドを待機しています。
+            </para>
+          </listitem>
+          <listitem>
+            <para>
+              <!--
+              <literal>Idle in transaction</literal>: The process is waiting for a new client command
+              in a transaction.
+              -->
+              <literal>Idle in transaction</literal>: トランザクション中にクライアントからのコマンドを待機しています。
+            </para>
+          </listitem>
+          <listitem>
+            <para>
+              <!--
+              <literal>Wait for connection</literal>: The process is waiting for a new client connection.
+              -->
+              <literal>Wait for connection</literal>: クライアントからの接続を待機しています。
+            </para>
+          </listitem>
+      </itemizedlist>
+     </para>
+    </listitem>
+
    </itemizedlist>
   </para>
   <para>
    返却行数は常に <xref linkend="guc-num-init-children"> * <xref linkend="guc-max-pool"> * 「バックエンドの数」になります。
      ここでは例を示します。
      <programlisting>
-      test=# show pool_pools;
-      pool_pid |     start_time      | pool_id | backend_id | database | username |     create_time     | majorversion | minorversion | pool_counter | pool_backendpid | pool_connected
-      ----------+---------------------+---------+------------+----------+----------+---------------------+--------------+--------------+--------------+-----------------+----------------
-      19696    | 2016-10-17 13:24:17 | 0       | 0          | postgres | t-ishii  | 2016-10-17 13:35:12 | 3            | 0            | 1            | 20079           | 1
-      19696    | 2016-10-17 13:24:17 | 0       | 1          | postgres | t-ishii  | 2016-10-17 13:35:12 | 3            | 0            | 1            | 20080           | 1
-      19696    | 2016-10-17 13:24:17 | 1       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19696    | 2016-10-17 13:24:17 | 1       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19696    | 2016-10-17 13:24:17 | 2       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19696    | 2016-10-17 13:24:17 | 2       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19696    | 2016-10-17 13:24:17 | 3       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19696    | 2016-10-17 13:24:17 | 3       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19697    | 2016-10-17 13:24:17 | 0       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19697    | 2016-10-17 13:24:17 | 0       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19697    | 2016-10-17 13:24:17 | 1       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19697    | 2016-10-17 13:24:17 | 1       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19697    | 2016-10-17 13:24:17 | 2       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19697    | 2016-10-17 13:24:17 | 2       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19697    | 2016-10-17 13:24:17 | 3       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19697    | 2016-10-17 13:24:17 | 3       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19698    | 2016-10-17 13:24:17 | 0       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19698    | 2016-10-17 13:24:17 | 0       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19698    | 2016-10-17 13:24:17 | 1       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19698    | 2016-10-17 13:24:17 | 1       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19698    | 2016-10-17 13:24:17 | 2       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19698    | 2016-10-17 13:24:17 | 2       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19698    | 2016-10-17 13:24:17 | 3       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19698    | 2016-10-17 13:24:17 | 3       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19699    | 2016-10-17 13:24:17 | 0       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19699    | 2016-10-17 13:24:17 | 0       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19699    | 2016-10-17 13:24:17 | 1       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19699    | 2016-10-17 13:24:17 | 1       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19699    | 2016-10-17 13:24:17 | 2       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19699    | 2016-10-17 13:24:17 | 2       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19699    | 2016-10-17 13:24:17 | 3       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19699    | 2016-10-17 13:24:17 | 3       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19700    | 2016-10-17 13:24:17 | 0       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19700    | 2016-10-17 13:24:17 | 0       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19700    | 2016-10-17 13:24:17 | 1       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19700    | 2016-10-17 13:24:17 | 1       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19700    | 2016-10-17 13:24:17 | 2       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19700    | 2016-10-17 13:24:17 | 2       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19700    | 2016-10-17 13:24:17 | 3       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19700    | 2016-10-17 13:24:17 | 3       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19701    | 2016-10-17 13:24:17 | 0       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19701    | 2016-10-17 13:24:17 | 0       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19701    | 2016-10-17 13:24:17 | 1       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19701    | 2016-10-17 13:24:17 | 1       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19701    | 2016-10-17 13:24:17 | 2       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19701    | 2016-10-17 13:24:17 | 2       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19701    | 2016-10-17 13:24:17 | 3       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19701    | 2016-10-17 13:24:17 | 3       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19702    | 2016-10-17 13:24:17 | 0       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19702    | 2016-10-17 13:24:17 | 0       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19702    | 2016-10-17 13:24:17 | 1       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19702    | 2016-10-17 13:24:17 | 1       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19702    | 2016-10-17 13:24:17 | 2       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19702    | 2016-10-17 13:24:17 | 2       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19702    | 2016-10-17 13:24:17 | 3       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19702    | 2016-10-17 13:24:17 | 3       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19703    | 2016-10-17 13:24:17 | 0       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19703    | 2016-10-17 13:24:17 | 0       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19703    | 2016-10-17 13:24:17 | 1       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19703    | 2016-10-17 13:24:17 | 1       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19703    | 2016-10-17 13:24:17 | 2       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19703    | 2016-10-17 13:24:17 | 2       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19703    | 2016-10-17 13:24:17 | 3       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19703    | 2016-10-17 13:24:17 | 3       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19704    | 2016-10-17 13:24:17 | 0       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19704    | 2016-10-17 13:24:17 | 0       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19704    | 2016-10-17 13:24:17 | 1       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19704    | 2016-10-17 13:24:17 | 1       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19704    | 2016-10-17 13:24:17 | 2       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19704    | 2016-10-17 13:24:17 | 2       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19704    | 2016-10-17 13:24:17 | 3       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19704    | 2016-10-17 13:24:17 | 3       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19705    | 2016-10-17 13:24:17 | 0       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19705    | 2016-10-17 13:24:17 | 0       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19705    | 2016-10-17 13:24:17 | 1       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19705    | 2016-10-17 13:24:17 | 1       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19705    | 2016-10-17 13:24:17 | 2       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19705    | 2016-10-17 13:24:17 | 2       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19705    | 2016-10-17 13:24:17 | 3       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19705    | 2016-10-17 13:24:17 | 3       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19706    | 2016-10-17 13:24:17 | 0       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19706    | 2016-10-17 13:24:17 | 0       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19706    | 2016-10-17 13:24:17 | 1       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19706    | 2016-10-17 13:24:17 | 1       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19706    | 2016-10-17 13:24:17 | 2       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19706    | 2016-10-17 13:24:17 | 2       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19706    | 2016-10-17 13:24:17 | 3       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19706    | 2016-10-17 13:24:17 | 3       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19707    | 2016-10-17 13:24:17 | 0       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19707    | 2016-10-17 13:24:17 | 0       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19707    | 2016-10-17 13:24:17 | 1       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19707    | 2016-10-17 13:24:17 | 1       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19707    | 2016-10-17 13:24:17 | 2       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19707    | 2016-10-17 13:24:17 | 2       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19707    | 2016-10-17 13:24:17 | 3       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19707    | 2016-10-17 13:24:17 | 3       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19708    | 2016-10-17 13:24:17 | 0       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19708    | 2016-10-17 13:24:17 | 0       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19708    | 2016-10-17 13:24:17 | 1       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19708    | 2016-10-17 13:24:17 | 1       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19708    | 2016-10-17 13:24:17 | 2       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19708    | 2016-10-17 13:24:17 | 2       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19708    | 2016-10-17 13:24:17 | 3       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19708    | 2016-10-17 13:24:17 | 3       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19709    | 2016-10-17 13:24:17 | 0       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19709    | 2016-10-17 13:24:17 | 0       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19709    | 2016-10-17 13:24:17 | 1       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19709    | 2016-10-17 13:24:17 | 1       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19709    | 2016-10-17 13:24:17 | 2       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19709    | 2016-10-17 13:24:17 | 2       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19709    | 2016-10-17 13:24:17 | 3       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19709    | 2016-10-17 13:24:17 | 3       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19710    | 2016-10-17 13:24:17 | 0       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19710    | 2016-10-17 13:24:17 | 0       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19710    | 2016-10-17 13:24:17 | 1       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19710    | 2016-10-17 13:24:17 | 1       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19710    | 2016-10-17 13:24:17 | 2       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19710    | 2016-10-17 13:24:17 | 2       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19710    | 2016-10-17 13:24:17 | 3       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19710    | 2016-10-17 13:24:17 | 3       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19711    | 2016-10-17 13:24:17 | 0       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19711    | 2016-10-17 13:24:17 | 0       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19711    | 2016-10-17 13:24:17 | 1       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19711    | 2016-10-17 13:24:17 | 1       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19711    | 2016-10-17 13:24:17 | 2       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19711    | 2016-10-17 13:24:17 | 2       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19711    | 2016-10-17 13:24:17 | 3       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19711    | 2016-10-17 13:24:17 | 3       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19712    | 2016-10-17 13:24:17 | 0       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19712    | 2016-10-17 13:24:17 | 0       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19712    | 2016-10-17 13:24:17 | 1       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19712    | 2016-10-17 13:24:17 | 1       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19712    | 2016-10-17 13:24:17 | 2       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19712    | 2016-10-17 13:24:17 | 2       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19712    | 2016-10-17 13:24:17 | 3       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19712    | 2016-10-17 13:24:17 | 3       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19713    | 2016-10-17 13:24:17 | 0       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19713    | 2016-10-17 13:24:17 | 0       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19713    | 2016-10-17 13:24:17 | 1       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19713    | 2016-10-17 13:24:17 | 1       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19713    | 2016-10-17 13:24:17 | 2       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19713    | 2016-10-17 13:24:17 | 2       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19713    | 2016-10-17 13:24:17 | 3       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19713    | 2016-10-17 13:24:17 | 3       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19714    | 2016-10-17 13:24:17 | 0       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19714    | 2016-10-17 13:24:17 | 0       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19714    | 2016-10-17 13:24:17 | 1       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19714    | 2016-10-17 13:24:17 | 1       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19714    | 2016-10-17 13:24:17 | 2       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19714    | 2016-10-17 13:24:17 | 2       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19714    | 2016-10-17 13:24:17 | 3       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19714    | 2016-10-17 13:24:17 | 3       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19715    | 2016-10-17 13:24:17 | 0       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19715    | 2016-10-17 13:24:17 | 0       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19715    | 2016-10-17 13:24:17 | 1       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19715    | 2016-10-17 13:24:17 | 1       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19715    | 2016-10-17 13:24:17 | 2       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19715    | 2016-10-17 13:24:17 | 2       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19715    | 2016-10-17 13:24:17 | 3       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19715    | 2016-10-17 13:24:17 | 3       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19716    | 2016-10-17 13:24:17 | 0       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19716    | 2016-10-17 13:24:17 | 0       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19716    | 2016-10-17 13:24:17 | 1       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19716    | 2016-10-17 13:24:17 | 1       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19716    | 2016-10-17 13:24:17 | 2       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19716    | 2016-10-17 13:24:17 | 2       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19716    | 2016-10-17 13:24:17 | 3       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19716    | 2016-10-17 13:24:17 | 3       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19717    | 2016-10-17 13:24:17 | 0       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19717    | 2016-10-17 13:24:17 | 0       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19717    | 2016-10-17 13:24:17 | 1       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19717    | 2016-10-17 13:24:17 | 1       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19717    | 2016-10-17 13:24:17 | 2       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19717    | 2016-10-17 13:24:17 | 2       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19717    | 2016-10-17 13:24:17 | 3       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19717    | 2016-10-17 13:24:17 | 3       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19718    | 2016-10-17 13:24:17 | 0       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19718    | 2016-10-17 13:24:17 | 0       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19718    | 2016-10-17 13:24:17 | 1       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19718    | 2016-10-17 13:24:17 | 1       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19718    | 2016-10-17 13:24:17 | 2       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19718    | 2016-10-17 13:24:17 | 2       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19718    | 2016-10-17 13:24:17 | 3       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19718    | 2016-10-17 13:24:17 | 3       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19719    | 2016-10-17 13:24:17 | 0       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19719    | 2016-10-17 13:24:17 | 0       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19719    | 2016-10-17 13:24:17 | 1       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19719    | 2016-10-17 13:24:17 | 1       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19719    | 2016-10-17 13:24:17 | 2       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19719    | 2016-10-17 13:24:17 | 2       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19719    | 2016-10-17 13:24:17 | 3       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19719    | 2016-10-17 13:24:17 | 3       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19720    | 2016-10-17 13:24:17 | 0       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19720    | 2016-10-17 13:24:17 | 0       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19720    | 2016-10-17 13:24:17 | 1       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19720    | 2016-10-17 13:24:17 | 1       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19720    | 2016-10-17 13:24:17 | 2       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19720    | 2016-10-17 13:24:17 | 2       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19720    | 2016-10-17 13:24:17 | 3       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19720    | 2016-10-17 13:24:17 | 3       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      20024    | 2016-10-17 13:33:46 | 0       | 0          | test     | t-ishii  | 2016-10-17 14:30:53 | 3            | 0            | 1            | 22055           | 1
-      20024    | 2016-10-17 13:33:46 | 0       | 1          | test     | t-ishii  | 2016-10-17 14:30:53 | 3            | 0            | 1            | 22056           | 1
-      20024    | 2016-10-17 13:33:46 | 1       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      20024    | 2016-10-17 13:33:46 | 1       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      20024    | 2016-10-17 13:33:46 | 2       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      20024    | 2016-10-17 13:33:46 | 2       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      20024    | 2016-10-17 13:33:46 | 3       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      20024    | 2016-10-17 13:33:46 | 3       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      20600    | 2016-10-17 13:46:58 | 0       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      20600    | 2016-10-17 13:46:58 | 0       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      20600    | 2016-10-17 13:46:58 | 1       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      20600    | 2016-10-17 13:46:58 | 1       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      20600    | 2016-10-17 13:46:58 | 2       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      20600    | 2016-10-17 13:46:58 | 2       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      20600    | 2016-10-17 13:46:58 | 3       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      20600    | 2016-10-17 13:46:58 | 3       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19723    | 2016-10-17 13:24:17 | 0       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19723    | 2016-10-17 13:24:17 | 0       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19723    | 2016-10-17 13:24:17 | 1       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19723    | 2016-10-17 13:24:17 | 1       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19723    | 2016-10-17 13:24:17 | 2       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19723    | 2016-10-17 13:24:17 | 2       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19723    | 2016-10-17 13:24:17 | 3       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19723    | 2016-10-17 13:24:17 | 3       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19724    | 2016-10-17 13:24:17 | 0       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19724    | 2016-10-17 13:24:17 | 0       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19724    | 2016-10-17 13:24:17 | 1       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19724    | 2016-10-17 13:24:17 | 1       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19724    | 2016-10-17 13:24:17 | 2       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19724    | 2016-10-17 13:24:17 | 2       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19724    | 2016-10-17 13:24:17 | 3       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19724    | 2016-10-17 13:24:17 | 3       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19725    | 2016-10-17 13:24:17 | 0       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19725    | 2016-10-17 13:24:17 | 0       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19725    | 2016-10-17 13:24:17 | 1       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19725    | 2016-10-17 13:24:17 | 1       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19725    | 2016-10-17 13:24:17 | 2       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19725    | 2016-10-17 13:24:17 | 2       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19725    | 2016-10-17 13:24:17 | 3       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19725    | 2016-10-17 13:24:17 | 3       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19726    | 2016-10-17 13:24:17 | 0       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19726    | 2016-10-17 13:24:17 | 0       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19726    | 2016-10-17 13:24:17 | 1       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19726    | 2016-10-17 13:24:17 | 1       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19726    | 2016-10-17 13:24:17 | 2       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19726    | 2016-10-17 13:24:17 | 2       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19726    | 2016-10-17 13:24:17 | 3       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19726    | 2016-10-17 13:24:17 | 3       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19727    | 2016-10-17 13:24:17 | 0       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19727    | 2016-10-17 13:24:17 | 0       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19727    | 2016-10-17 13:24:17 | 1       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19727    | 2016-10-17 13:24:17 | 1       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19727    | 2016-10-17 13:24:17 | 2       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19727    | 2016-10-17 13:24:17 | 2       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19727    | 2016-10-17 13:24:17 | 3       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19727    | 2016-10-17 13:24:17 | 3       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      (256 rows)
+postgres=# show pool_pools;
+ pool_pid |              start_time               | client_connection_count | pool_id | backend_id | database | username | backend_connection_time | client_connection_time | client_disconnection_time | client_idle_duration | majorversion | minorversion | pool_counter | pool_backendpid | pool_connected |       status
+----------+---------------------------------------+-------------------------+---------+------------+----------+----------+-------------------------+------------------------+---------------------------+----------------------+--------------+--------------+--------------+-----------------+----------------+---------------------
+ 3727     | 2021-09-07 02:29:38 (remaining: 5:00) | 0                       | 0       | 0          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Wait for connection
+ 3727     | 2021-09-07 02:29:38 (remaining: 5:00) | 0                       | 0       | 1          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Wait for connection
+ 3727     | 2021-09-07 02:29:38 (remaining: 5:00) | 0                       | 1       | 0          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Wait for connection
+ 3727     | 2021-09-07 02:29:38 (remaining: 5:00) | 0                       | 1       | 1          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Wait for connection
+ 3727     | 2021-09-07 02:29:38 (remaining: 5:00) | 0                       | 2       | 0          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Wait for connection
+ 3727     | 2021-09-07 02:29:38 (remaining: 5:00) | 0                       | 2       | 1          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Wait for connection
+ 3727     | 2021-09-07 02:29:38 (remaining: 5:00) | 0                       | 3       | 0          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Wait for connection
+ 3727     | 2021-09-07 02:29:38 (remaining: 5:00) | 0                       | 3       | 1          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Wait for connection
+ 3728     | 2021-09-07 02:29:38 (remaining: 5:00) | 0                       | 0       | 0          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Wait for connection
+ 3728     | 2021-09-07 02:29:38 (remaining: 5:00) | 0                       | 0       | 1          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Wait for connection
+ 3728     | 2021-09-07 02:29:38 (remaining: 5:00) | 0                       | 1       | 0          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Wait for connection
+ 3728     | 2021-09-07 02:29:38 (remaining: 5:00) | 0                       | 1       | 1          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Wait for connection
+ 3728     | 2021-09-07 02:29:38 (remaining: 5:00) | 0                       | 2       | 0          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Wait for connection
+ 3728     | 2021-09-07 02:29:38 (remaining: 5:00) | 0                       | 2       | 1          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Wait for connection
+ 3728     | 2021-09-07 02:29:38 (remaining: 5:00) | 0                       | 3       | 0          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Wait for connection
+ 3728     | 2021-09-07 02:29:38 (remaining: 5:00) | 0                       | 3       | 1          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Wait for connection
+ 3729     | 2021-09-07 02:29:38 (remaining: 3:30) | 1                       | 0       | 0          | postgres | postgres | 2021-09-07 02:29:47     | 2021-09-07 02:29:47    | 2021-09-07 02:29:46       | 90                   | 3            | 0            | 1            | 3749            | 1              | Idle
+ 3729     | 2021-09-07 02:29:38 (remaining: 3:30) | 1                       | 0       | 1          | postgres | postgres | 2021-09-07 02:29:47     | 2021-09-07 02:29:47    | 2021-09-07 02:29:46       | 0                    | 3            | 0            | 1            | 3750            | 1              | Idle
+ 3729     | 2021-09-07 02:29:38 (remaining: 3:30) | 1                       | 1       | 0          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Idle
+ 3729     | 2021-09-07 02:29:38 (remaining: 3:30) | 1                       | 1       | 1          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Idle
+ 3729     | 2021-09-07 02:29:38 (remaining: 3:30) | 1                       | 2       | 0          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Idle
+ 3729     | 2021-09-07 02:29:38 (remaining: 3:30) | 1                       | 2       | 1          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Idle
+ 3729     | 2021-09-07 02:29:38 (remaining: 3:30) | 1                       | 3       | 0          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Idle
+ 3729     | 2021-09-07 02:29:38 (remaining: 3:30) | 1                       | 3       | 1          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Idle
+ 3730     | 2021-09-07 02:29:38 (remaining: 5:00) | 0                       | 0       | 0          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Wait for connection
+ 3730     | 2021-09-07 02:29:38 (remaining: 5:00) | 0                       | 0       | 1          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Wait for connection
+ 3730     | 2021-09-07 02:29:38 (remaining: 5:00) | 0                       | 1       | 0          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Wait for connection
+ 3730     | 2021-09-07 02:29:38 (remaining: 5:00) | 0                       | 1       | 1          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Wait for connection
+ 3730     | 2021-09-07 02:29:38 (remaining: 5:00) | 0                       | 2       | 0          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Wait for connection
+ 3730     | 2021-09-07 02:29:38 (remaining: 5:00) | 0                       | 2       | 1          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Wait for connection
+ 3730     | 2021-09-07 02:29:38 (remaining: 5:00) | 0                       | 3       | 0          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Wait for connection
+ 3730     | 2021-09-07 02:29:38 (remaining: 5:00) | 0                       | 3       | 1          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Wait for connection
+ 3731     | 2021-09-07 02:29:38 (remaining: 5:00) | 0                       | 0       | 0          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Wait for connection
+ 3731     | 2021-09-07 02:29:38 (remaining: 5:00) | 0                       | 0       | 1          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Wait for connection
+ 3731     | 2021-09-07 02:29:38 (remaining: 5:00) | 0                       | 1       | 0          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Wait for connection
+ 3731     | 2021-09-07 02:29:38 (remaining: 5:00) | 0                       | 1       | 1          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Wait for connection
+ 3731     | 2021-09-07 02:29:38 (remaining: 5:00) | 0                       | 2       | 0          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Wait for connection
+ 3731     | 2021-09-07 02:29:38 (remaining: 5:00) | 0                       | 2       | 1          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Wait for connection
+ 3731     | 2021-09-07 02:29:38 (remaining: 5:00) | 0                       | 3       | 0          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Wait for connection
+ 3731     | 2021-09-07 02:29:38 (remaining: 5:00) | 0                       | 3       | 1          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Wait for connection
+ 3732     | 2021-09-07 02:29:38 (remaining: 5:00) | 0                       | 0       | 0          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Wait for connection
+ 3732     | 2021-09-07 02:29:38 (remaining: 5:00) | 0                       | 0       | 1          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Wait for connection
+ 3732     | 2021-09-07 02:29:38 (remaining: 5:00) | 0                       | 1       | 0          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Wait for connection
+ 3732     | 2021-09-07 02:29:38 (remaining: 5:00) | 0                       | 1       | 1          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Wait for connection
+ 3732     | 2021-09-07 02:29:38 (remaining: 5:00) | 0                       | 2       | 0          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Wait for connection
+ 3732     | 2021-09-07 02:29:38 (remaining: 5:00) | 0                       | 2       | 1          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Wait for connection
+ 3732     | 2021-09-07 02:29:38 (remaining: 5:00) | 0                       | 3       | 0          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Wait for connection
+ 3732     | 2021-09-07 02:29:38 (remaining: 5:00) | 0                       | 3       | 1          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Wait for connection
+ 3733     | 2021-09-07 02:29:38 (remaining: 5:00) | 0                       | 0       | 0          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Wait for connection
+ 3733     | 2021-09-07 02:29:38 (remaining: 5:00) | 0                       | 0       | 1          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Wait for connection
+ 3733     | 2021-09-07 02:29:38 (remaining: 5:00) | 0                       | 1       | 0          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Wait for connection
+ 3733     | 2021-09-07 02:29:38 (remaining: 5:00) | 0                       | 1       | 1          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Wait for connection
+ 3733     | 2021-09-07 02:29:38 (remaining: 5:00) | 0                       | 2       | 0          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Wait for connection
+ 3733     | 2021-09-07 02:29:38 (remaining: 5:00) | 0                       | 2       | 1          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Wait for connection
+ 3733     | 2021-09-07 02:29:38 (remaining: 5:00) | 0                       | 3       | 0          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Wait for connection
+ 3733     | 2021-09-07 02:29:38 (remaining: 5:00) | 0                       | 3       | 1          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Wait for connection
+ 3734     | 2021-09-07 02:29:38 (remaining: 5:00) | 4                       | 0       | 0          | postgres | postgres | 2021-09-07 02:31:22     | 2021-09-07 02:31:22    | 2021-09-07 02:31:15       | 0                    | 3            | 0            | 1            | 3823            | 1              | Execute command
+ 3734     | 2021-09-07 02:29:38 (remaining: 5:00) | 4                       | 0       | 1          | postgres | postgres | 2021-09-07 02:31:22     | 2021-09-07 02:31:22    | 2021-09-07 02:31:15       | 0                    | 3            | 0            | 1            | 3824            | 1              | Execute command
+ 3734     | 2021-09-07 02:29:38 (remaining: 5:00) | 4                       | 1       | 0          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Execute command
+ 3734     | 2021-09-07 02:29:38 (remaining: 5:00) | 4                       | 1       | 1          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Execute command
+ 3734     | 2021-09-07 02:29:38 (remaining: 5:00) | 4                       | 2       | 0          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Execute command
+ 3734     | 2021-09-07 02:29:38 (remaining: 5:00) | 4                       | 2       | 1          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Execute command
+ 3734     | 2021-09-07 02:29:38 (remaining: 5:00) | 4                       | 3       | 0          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Execute command
+ 3734     | 2021-09-07 02:29:38 (remaining: 5:00) | 4                       | 3       | 1          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Execute command
+(64 rows)
      </programlisting>
 
   </para>
index 05c4951d352431f93868ecd2bb22b2c003e12aee..6c8e360bb4efba845fc550b1bf922ea236c7c8b3 100644 (file)
@@ -21,7 +21,7 @@
    sends back a list of all <productname>Pgpool-II</productname>
    processes waiting for connections and dealing with a connection
    -->
-   接続待ち、あるいは接続中 <productname>Pgpool-II</productname> の子プロセスの状態を表示する
+   接続待ち、あるいは接続中 <productname>Pgpool-II</productname> の子プロセスの状態を表示する
   </refpurpose>
  </refnamediv>
 
    <productname>Pgpool-II</productname> processes waiting for
    connections and dealing with a connection.
    -->
-   <command>SHOW POOL_PROCESSES</command> は接続待ち、あるいは接続中
+   <command>SHOW POOL_PROCESSES</command> は接続待ち、あるいは接続中
    <productname>Pgpool-II</productname> の子プロセスの状態を表示します。
   </para>
   <para>
    <!--
-   It has 6 columns:
+   It has 8 columns:
    -->
-   6つのカラムがあります。
+   8つのカラムがあります。
    <itemizedlist>
     <listitem>
      <para>
       this process was launched.
       -->
       <literal>start_time</literal> はこのプロセスが起動された時刻です。
+      <itemizedlist>
+       <listitem>
+        <para>
+         <!--
+         <literal>remaining</literal> is the remaining time by
+         <xref linkend="guc-client-idle-limit">. If
+         <literal>client_idle_limit</literal> is set 0,
+         <literal>remaining</literal> is not desplayed.
+         -->
+         <literal>remaining</literal> は <xref linkend="guc-client-idle-limit"> に
+         よる残り時間です。<literal>client_idle_limit</literal> が 0 の場合、
+         <literal>remaining</literal> は表示されません。
+        </para>
+       </listitem>
+      </itemizedlist>
+     </para>
+    </listitem>
+    <listitem>
+     <para>
+      <!--
+      <literal>client_connection_count</literal> counts the number of times
+      this process has been used by clients.
+      -->
+      <literal>client_connection_count</literal> はこのプロセスが使用された回数です。
      </para>
     </listitem>
     <listitem>
     <listitem>
      <para>
       <!--
-      <literal>create_time</literal> is the creation time and
+      <literal>backend_connection_time</literal> is the creation time and
       date of the connection.
       -->
-      <literal>create_time</literal> はこの接続が作成された時刻です。
+      <literal>backend_connection_time</literal> はこの接続が作成された時刻です。
      </para>
     </listitem>
     <listitem>
       <literal>pool_counter</literal> はこの接続が使用された回数です。
      </para>
     </listitem>
+    <listitem>
+     <para>
+      <!--
+      <literal>status</literal> is current status of this process. Possible values are:
+      -->
+      <literal>status</literal> は現在のプロセスの状態です。以下のいずれかの値を取ります:
+        <itemizedlist>
+          <listitem>
+            <para>
+              <!--
+              <literal>Execute command</literal>: Executing a command.
+              -->
+              <literal>Execute command</literal>: コマンドを実行中です。
+            </para>
+          </listitem>
+          <listitem>
+            <para>
+              <!--
+              <literal>Idle</literal>: The process is waiting for a new client command.
+              -->
+              <literal>Idle</literal>: クライアントからのコマンドを待機しています。
+            </para>
+          </listitem>
+          <listitem>
+            <para>
+              <!--
+              <literal>Idle in transaction</literal>: The process is waiting for a new client command
+              in a transaction.
+              -->
+              <literal>Idle in transaction</literal>: トランザクション中にクライアントからのコマンドを待機しています。
+            </para>
+          </listitem>
+          <listitem>
+            <para>
+              <!--
+              <literal>Wait for connection</literal>: The process is waiting for a new client connection.
+              -->
+              <literal>Wait for connection</literal>: クライアントからの接続を待機しています。
+            </para>
+          </listitem>
+      </itemizedlist>
+     </para>
+    </listitem>
    </itemizedlist>
   </para>
   <para>
    ここでは例を示します。
 
    <programlisting>
-    test=# show pool_processes;
-    pool_pid |     start_time      | database | username |     create_time     | pool_counter
-    ----------+---------------------+----------+----------+---------------------+--------------
-    19696    | 2016-10-17 13:24:17 | postgres | t-ishii  | 2016-10-17 13:35:12 | 1
-    19697    | 2016-10-17 13:24:17 |          |          |                     |
-    19698    | 2016-10-17 13:24:17 |          |          |                     |
-    19699    | 2016-10-17 13:24:17 |          |          |                     |
-    19700    | 2016-10-17 13:24:17 |          |          |                     |
-    19701    | 2016-10-17 13:24:17 |          |          |                     |
-    19702    | 2016-10-17 13:24:17 |          |          |                     |
-    19703    | 2016-10-17 13:24:17 |          |          |                     |
-    19704    | 2016-10-17 13:24:17 |          |          |                     |
-    19705    | 2016-10-17 13:24:17 |          |          |                     |
-    19706    | 2016-10-17 13:24:17 |          |          |                     |
-    19707    | 2016-10-17 13:24:17 |          |          |                     |
-    19708    | 2016-10-17 13:24:17 |          |          |                     |
-    19709    | 2016-10-17 13:24:17 |          |          |                     |
-    19710    | 2016-10-17 13:24:17 |          |          |                     |
-    19711    | 2016-10-17 13:24:17 |          |          |                     |
-    19712    | 2016-10-17 13:24:17 |          |          |                     |
-    19713    | 2016-10-17 13:24:17 |          |          |                     |
-    19714    | 2016-10-17 13:24:17 |          |          |                     |
-    19715    | 2016-10-17 13:24:17 |          |          |                     |
-    19716    | 2016-10-17 13:24:17 |          |          |                     |
-    19717    | 2016-10-17 13:24:17 |          |          |                     |
-    19718    | 2016-10-17 13:24:17 |          |          |                     |
-    19719    | 2016-10-17 13:24:17 |          |          |                     |
-    19720    | 2016-10-17 13:24:17 |          |          |                     |
-    20024    | 2016-10-17 13:33:46 |          |          |                     |
-    19722    | 2016-10-17 13:24:17 | test     | t-ishii  | 2016-10-17 13:34:42 | 1
-    19723    | 2016-10-17 13:24:17 |          |          |                     |
-    19724    | 2016-10-17 13:24:17 |          |          |                     |
-    19725    | 2016-10-17 13:24:17 |          |          |                     |
-    19726    | 2016-10-17 13:24:17 |          |          |                     |
-    19727    | 2016-10-17 13:24:17 |          |          |                     |
-    (32 rows)
+postgres=# show pool_processes;
+ pool_pid |              start_time               | client_connection_count | database | username | backend_connection_time | pool_counter |       status
+----------+---------------------------------------+-------------------------+----------+----------+-------------------------+--------------+---------------------
+ 6685     | 2021-09-07 02:41:13 (remaining: 5:00) | 0                       |          |          |                         |              | Wait for connection
+ 6686     | 2021-09-07 02:41:13 (remaining: 5:00) | 0                       |          |          |                         |              | Wait for connection
+ 6687     | 2021-09-07 02:41:13 (remaining: 5:00) | 0                       |          |          |                         |              | Wait for connection
+ 6688     | 2021-09-07 02:41:13 (remaining: 4:10) | 1                       | postgres | postgres | 2021-09-07 02:41:48     | 1            | Idle
+ 6689     | 2021-09-07 02:41:13 (remaining: 5:00) | 0                       |          |          |                         |              | Wait for connection
+ 6690     | 2021-09-07 02:41:13 (remaining: 5:00) | 0                       |          |          |                         |              | Wait for connection
+ 6691     | 2021-09-07 02:41:13 (remaining: 5:00) | 0                       |          |          |                         |              | Wait for connection
+ 6692     | 2021-09-07 02:41:13 (remaining: 5:00) | 2                       | postgres | postgres | 2021-09-07 02:42:38     | 1            | Execute command
+(8 rows)
    </programlisting>
   </para>
  </refsect1>
index de07f307989fb24d25350652c7f7bdcc34c99536..6602d4e7c9bf6f3ba0b043a44450aa0fa422007e 100644 (file)
@@ -85,9 +85,9 @@ Pgpool-II documentation
   <para>
    Here is an example output:
    <programlisting>
-    $ pcp_proc_info -p 11001 1406
-    test t-ishii 2018-07-09 16:43:53 2018-07-09 16:44:08 3 0 1 1435 1 1406 0
-    test t-ishii 2018-07-09 16:43:53 2018-07-09 16:44:08 3 0 1 1436 1 1406 1
+$ pcp_proc_info -p 11001 2871
+postgres postgres 2021-09-07 02:12:53 (remaining: 0:27) 1 3 0 2021-09-07 02:16:59 2021-09-07 02:16:59 273 2021-09-07 02:16:56 1 3016 1 2871 0 Idle
+postgres postgres 2021-09-07 02:12:53 (remaining: 0:27) 1 3 0 2021-09-07 02:16:59 2021-09-07 02:16:59 0 2021-09-07 02:16:56 1 3017 1 2871 1 Idle
    </programlisting>
   </para>
   <para>
@@ -95,15 +95,20 @@ Pgpool-II documentation
    <literallayout class="monospaced">
     1. connected database name
     2. connected user name
-    3. process start-up timestamp
-    4. connection created timestamp
+    3. process start-up timestamp (remaining time by <xref linkend="guc-client-idle-limit">. If client_idle_limit is set 0, remaining is not desplayed.)
+    4. process-reuse counter for <xref linkend="guc-child-max-connections">
     5. protocol major version
     6. protocol minor version
-    7. connection-reuse counter
-    8. PostgreSQL backend process id
-    9. 1 if frontend connected 0 if not
-    10. pgpool child process id
-    11. PostgreSQL backend id 
+    7. connection created timestamp
+    8. last client connected timestamp
+    9. client idle duration (sec) for <xref linkend="guc-client-idle-limit">
+    10. last client disconnected timestamp
+    11. connection-reuse counter
+    12. PostgreSQL backend process id
+    13. 1 if frontend connected 0 if not
+    14. pgpool child process id
+    15. PostgreSQL backend id
+    16. process status
    </literallayout>
   </para>
   <para>
@@ -116,29 +121,40 @@ Pgpool-II documentation
    The <option>--verbose</option> option can help understand the output. For example:
   </para>
   <programlisting>
-   $ pcp_proc_info -p 11001 --verbose 1406
-   Database     : test
-   Username     : t-ishii
-   Start time   : 2018-07-09 16:43:53
-   Creation time: 2018-07-09 16:44:08
-   Major        : 3
-   Minor        : 0
-   Counter      : 1
-   Backend PID  : 1435
-   Connected    : 1
-   PID          : 1406
-   Backend ID   : 0
-   Database     : test
-   Username     : t-ishii
-   Start time   : 2018-07-09 16:43:53
-   Creation time: 2018-07-09 16:44:08
-   Major        : 3
-   Minor        : 0
-   Counter      : 1
-   Backend PID  : 1436
-   Connected    : 1
-   PID          : 1406
-   Backend ID   : 1
+$ pcp_proc_info -p 11001 --verbose 2871
+Database                  : postgres
+Username                  : postgres
+Start time                : 2021-09-07 02:12:53 (remaining: 3:36)
+Client connection count   : 1
+Major                     : 3
+Minor                     : 0
+Backend connection time   : 2021-09-07 02:16:59
+Client connection time    : 2021-09-07 02:16:59
+Client idle duration      : 84
+Client disconnection time : 2021-09-07 02:16:56
+Pool Counter              : 1
+Backend PID               : 3016
+Connected                 : 1
+PID                       : 2871
+Backend ID                : 0
+Status                    : Idle
+
+Database                  : postgres
+Username                  : postgres
+Start time                : 2021-09-07 02:12:53 (remaining: 3:36)
+Client connection count   : 1
+Major                     : 3
+Minor                     : 0
+Backend connection time   : 2021-09-07 02:16:59
+Client connection time    : 2021-09-07 02:16:59
+Client idle duration      : 0
+Client disconnection time : 2021-09-07 02:16:56
+Pool Counter              : 1
+Backend PID               : 3017
+Connected                 : 1
+PID                       : 2871
+Backend ID                : 1
+Status                    : Idle
   </programlisting>
  </refsect1>
 
index 54c664319ac0912666eacd2deb8370c63434f92e..5ece2ee5466b61fbbc17250baa6ffccb52656acb 100644 (file)
@@ -37,7 +37,7 @@
    <productname>Pgpool-II</productname>
   </para>
   <para>
-   It has 12 columns:
+   It has 17 columns:
    <itemizedlist>
     <listitem>
      <para>
      <para>
       <literal>start_time</literal> is the timestamp of when
       this process was launched.
+      <itemizedlist>
+       <listitem>
+        <para>
+         <literal>remaining</literal> is the remaining time by
+         <xref linkend="guc-client-idle-limit">. If
+         <literal>client_idle_limit</literal> is set 0,
+         <literal>remaining</literal> is not desplayed.
+        </para>
+       </listitem>
+      </itemizedlist>
+     </para>
+    </listitem>
+
+    <listitem>
+     <para>
+      <literal>client_connection_count</literal> counts the number of times
+      this process has been used by clients.
      </para>
     </listitem>
 
 
     <listitem>
      <para>
-      <literal>create_time</literal> is the creation time and
+      <literal>backend_connection_time</literal> is the creation time and
       date of the connection.
      </para>
     </listitem>
 
+    <listitem>
+     <para>
+      <literal>client_connection_time</literal> is the date when a client
+      last used this connection.
+     </para>
+    </listitem>
+
+    <listitem>
+     <para>
+      <literal>client_disconnection_time</literal> is the date when a client
+      last disconnected from this connection.
+     </para>
+    </listitem>
+
+    <listitem>
+     <para>
+      <literal>client_idle_duration</literal> is the time (sec) that a client
+      is in idle.
+     </para>
+    </listitem>
+
     <listitem>
      <para>
       <literal>majorversion</literal>
      </para>
     </listitem>
 
+    <listitem>
+     <para>
+      <literal>status</literal> is current status of this process. Possible values are:
+        <itemizedlist>
+          <listitem>
+            <para>
+              <literal>Execute command</literal>: Executing a command.
+            </para>
+          </listitem>
+          <listitem>
+            <para>
+              <literal>Idle</literal>: The process is waiting for a new client command.
+            </para>
+          </listitem>
+          <listitem>
+            <para>
+              <literal>Idle in transaction</literal>: The process is waiting for a new client command
+              in a transaction.
+            </para>
+          </listitem>
+          <listitem>
+            <para>
+              <literal>Wait for connection</literal>: The process is waiting for a new client connection.
+            </para>
+          </listitem>
+      </itemizedlist>
+     </para>
+    </listitem>
+
    </itemizedlist>
   </para>
   <para>
    It'll always return <xref linkend="guc-num-init-children"> * <xref linkend="guc-max-pool"> *
      number_of_backends lines.  Here is an example session:
      <programlisting>
-      test=# show pool_pools;
-      pool_pid |     start_time      | pool_id | backend_id | database | username |     create_time     | majorversion | minorversion | pool_counter | pool_backendpid | pool_connected
-      ----------+---------------------+---------+------------+----------+----------+---------------------+--------------+--------------+--------------+-----------------+----------------
-      19696    | 2016-10-17 13:24:17 | 0       | 0          | postgres | t-ishii  | 2016-10-17 13:35:12 | 3            | 0            | 1            | 20079           | 1
-      19696    | 2016-10-17 13:24:17 | 0       | 1          | postgres | t-ishii  | 2016-10-17 13:35:12 | 3            | 0            | 1            | 20080           | 1
-      19696    | 2016-10-17 13:24:17 | 1       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19696    | 2016-10-17 13:24:17 | 1       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19696    | 2016-10-17 13:24:17 | 2       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19696    | 2016-10-17 13:24:17 | 2       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19696    | 2016-10-17 13:24:17 | 3       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19696    | 2016-10-17 13:24:17 | 3       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19697    | 2016-10-17 13:24:17 | 0       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19697    | 2016-10-17 13:24:17 | 0       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19697    | 2016-10-17 13:24:17 | 1       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19697    | 2016-10-17 13:24:17 | 1       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19697    | 2016-10-17 13:24:17 | 2       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19697    | 2016-10-17 13:24:17 | 2       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19697    | 2016-10-17 13:24:17 | 3       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19697    | 2016-10-17 13:24:17 | 3       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19698    | 2016-10-17 13:24:17 | 0       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19698    | 2016-10-17 13:24:17 | 0       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19698    | 2016-10-17 13:24:17 | 1       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19698    | 2016-10-17 13:24:17 | 1       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19698    | 2016-10-17 13:24:17 | 2       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19698    | 2016-10-17 13:24:17 | 2       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19698    | 2016-10-17 13:24:17 | 3       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19698    | 2016-10-17 13:24:17 | 3       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19699    | 2016-10-17 13:24:17 | 0       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19699    | 2016-10-17 13:24:17 | 0       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19699    | 2016-10-17 13:24:17 | 1       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19699    | 2016-10-17 13:24:17 | 1       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19699    | 2016-10-17 13:24:17 | 2       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19699    | 2016-10-17 13:24:17 | 2       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19699    | 2016-10-17 13:24:17 | 3       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19699    | 2016-10-17 13:24:17 | 3       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19700    | 2016-10-17 13:24:17 | 0       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19700    | 2016-10-17 13:24:17 | 0       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19700    | 2016-10-17 13:24:17 | 1       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19700    | 2016-10-17 13:24:17 | 1       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19700    | 2016-10-17 13:24:17 | 2       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19700    | 2016-10-17 13:24:17 | 2       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19700    | 2016-10-17 13:24:17 | 3       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19700    | 2016-10-17 13:24:17 | 3       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19701    | 2016-10-17 13:24:17 | 0       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19701    | 2016-10-17 13:24:17 | 0       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19701    | 2016-10-17 13:24:17 | 1       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19701    | 2016-10-17 13:24:17 | 1       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19701    | 2016-10-17 13:24:17 | 2       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19701    | 2016-10-17 13:24:17 | 2       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19701    | 2016-10-17 13:24:17 | 3       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19701    | 2016-10-17 13:24:17 | 3       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19702    | 2016-10-17 13:24:17 | 0       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19702    | 2016-10-17 13:24:17 | 0       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19702    | 2016-10-17 13:24:17 | 1       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19702    | 2016-10-17 13:24:17 | 1       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19702    | 2016-10-17 13:24:17 | 2       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19702    | 2016-10-17 13:24:17 | 2       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19702    | 2016-10-17 13:24:17 | 3       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19702    | 2016-10-17 13:24:17 | 3       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19703    | 2016-10-17 13:24:17 | 0       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19703    | 2016-10-17 13:24:17 | 0       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19703    | 2016-10-17 13:24:17 | 1       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19703    | 2016-10-17 13:24:17 | 1       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19703    | 2016-10-17 13:24:17 | 2       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19703    | 2016-10-17 13:24:17 | 2       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19703    | 2016-10-17 13:24:17 | 3       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19703    | 2016-10-17 13:24:17 | 3       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19704    | 2016-10-17 13:24:17 | 0       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19704    | 2016-10-17 13:24:17 | 0       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19704    | 2016-10-17 13:24:17 | 1       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19704    | 2016-10-17 13:24:17 | 1       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19704    | 2016-10-17 13:24:17 | 2       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19704    | 2016-10-17 13:24:17 | 2       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19704    | 2016-10-17 13:24:17 | 3       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19704    | 2016-10-17 13:24:17 | 3       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19705    | 2016-10-17 13:24:17 | 0       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19705    | 2016-10-17 13:24:17 | 0       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19705    | 2016-10-17 13:24:17 | 1       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19705    | 2016-10-17 13:24:17 | 1       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19705    | 2016-10-17 13:24:17 | 2       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19705    | 2016-10-17 13:24:17 | 2       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19705    | 2016-10-17 13:24:17 | 3       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19705    | 2016-10-17 13:24:17 | 3       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19706    | 2016-10-17 13:24:17 | 0       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19706    | 2016-10-17 13:24:17 | 0       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19706    | 2016-10-17 13:24:17 | 1       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19706    | 2016-10-17 13:24:17 | 1       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19706    | 2016-10-17 13:24:17 | 2       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19706    | 2016-10-17 13:24:17 | 2       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19706    | 2016-10-17 13:24:17 | 3       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19706    | 2016-10-17 13:24:17 | 3       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19707    | 2016-10-17 13:24:17 | 0       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19707    | 2016-10-17 13:24:17 | 0       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19707    | 2016-10-17 13:24:17 | 1       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19707    | 2016-10-17 13:24:17 | 1       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19707    | 2016-10-17 13:24:17 | 2       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19707    | 2016-10-17 13:24:17 | 2       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19707    | 2016-10-17 13:24:17 | 3       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19707    | 2016-10-17 13:24:17 | 3       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19708    | 2016-10-17 13:24:17 | 0       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19708    | 2016-10-17 13:24:17 | 0       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19708    | 2016-10-17 13:24:17 | 1       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19708    | 2016-10-17 13:24:17 | 1       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19708    | 2016-10-17 13:24:17 | 2       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19708    | 2016-10-17 13:24:17 | 2       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19708    | 2016-10-17 13:24:17 | 3       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19708    | 2016-10-17 13:24:17 | 3       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19709    | 2016-10-17 13:24:17 | 0       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19709    | 2016-10-17 13:24:17 | 0       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19709    | 2016-10-17 13:24:17 | 1       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19709    | 2016-10-17 13:24:17 | 1       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19709    | 2016-10-17 13:24:17 | 2       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19709    | 2016-10-17 13:24:17 | 2       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19709    | 2016-10-17 13:24:17 | 3       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19709    | 2016-10-17 13:24:17 | 3       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19710    | 2016-10-17 13:24:17 | 0       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19710    | 2016-10-17 13:24:17 | 0       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19710    | 2016-10-17 13:24:17 | 1       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19710    | 2016-10-17 13:24:17 | 1       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19710    | 2016-10-17 13:24:17 | 2       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19710    | 2016-10-17 13:24:17 | 2       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19710    | 2016-10-17 13:24:17 | 3       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19710    | 2016-10-17 13:24:17 | 3       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19711    | 2016-10-17 13:24:17 | 0       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19711    | 2016-10-17 13:24:17 | 0       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19711    | 2016-10-17 13:24:17 | 1       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19711    | 2016-10-17 13:24:17 | 1       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19711    | 2016-10-17 13:24:17 | 2       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19711    | 2016-10-17 13:24:17 | 2       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19711    | 2016-10-17 13:24:17 | 3       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19711    | 2016-10-17 13:24:17 | 3       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19712    | 2016-10-17 13:24:17 | 0       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19712    | 2016-10-17 13:24:17 | 0       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19712    | 2016-10-17 13:24:17 | 1       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19712    | 2016-10-17 13:24:17 | 1       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19712    | 2016-10-17 13:24:17 | 2       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19712    | 2016-10-17 13:24:17 | 2       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19712    | 2016-10-17 13:24:17 | 3       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19712    | 2016-10-17 13:24:17 | 3       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19713    | 2016-10-17 13:24:17 | 0       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19713    | 2016-10-17 13:24:17 | 0       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19713    | 2016-10-17 13:24:17 | 1       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19713    | 2016-10-17 13:24:17 | 1       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19713    | 2016-10-17 13:24:17 | 2       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19713    | 2016-10-17 13:24:17 | 2       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19713    | 2016-10-17 13:24:17 | 3       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19713    | 2016-10-17 13:24:17 | 3       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19714    | 2016-10-17 13:24:17 | 0       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19714    | 2016-10-17 13:24:17 | 0       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19714    | 2016-10-17 13:24:17 | 1       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19714    | 2016-10-17 13:24:17 | 1       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19714    | 2016-10-17 13:24:17 | 2       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19714    | 2016-10-17 13:24:17 | 2       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19714    | 2016-10-17 13:24:17 | 3       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19714    | 2016-10-17 13:24:17 | 3       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19715    | 2016-10-17 13:24:17 | 0       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19715    | 2016-10-17 13:24:17 | 0       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19715    | 2016-10-17 13:24:17 | 1       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19715    | 2016-10-17 13:24:17 | 1       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19715    | 2016-10-17 13:24:17 | 2       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19715    | 2016-10-17 13:24:17 | 2       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19715    | 2016-10-17 13:24:17 | 3       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19715    | 2016-10-17 13:24:17 | 3       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19716    | 2016-10-17 13:24:17 | 0       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19716    | 2016-10-17 13:24:17 | 0       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19716    | 2016-10-17 13:24:17 | 1       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19716    | 2016-10-17 13:24:17 | 1       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19716    | 2016-10-17 13:24:17 | 2       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19716    | 2016-10-17 13:24:17 | 2       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19716    | 2016-10-17 13:24:17 | 3       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19716    | 2016-10-17 13:24:17 | 3       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19717    | 2016-10-17 13:24:17 | 0       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19717    | 2016-10-17 13:24:17 | 0       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19717    | 2016-10-17 13:24:17 | 1       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19717    | 2016-10-17 13:24:17 | 1       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19717    | 2016-10-17 13:24:17 | 2       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19717    | 2016-10-17 13:24:17 | 2       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19717    | 2016-10-17 13:24:17 | 3       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19717    | 2016-10-17 13:24:17 | 3       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19718    | 2016-10-17 13:24:17 | 0       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19718    | 2016-10-17 13:24:17 | 0       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19718    | 2016-10-17 13:24:17 | 1       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19718    | 2016-10-17 13:24:17 | 1       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19718    | 2016-10-17 13:24:17 | 2       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19718    | 2016-10-17 13:24:17 | 2       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19718    | 2016-10-17 13:24:17 | 3       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19718    | 2016-10-17 13:24:17 | 3       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19719    | 2016-10-17 13:24:17 | 0       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19719    | 2016-10-17 13:24:17 | 0       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19719    | 2016-10-17 13:24:17 | 1       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19719    | 2016-10-17 13:24:17 | 1       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19719    | 2016-10-17 13:24:17 | 2       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19719    | 2016-10-17 13:24:17 | 2       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19719    | 2016-10-17 13:24:17 | 3       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19719    | 2016-10-17 13:24:17 | 3       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19720    | 2016-10-17 13:24:17 | 0       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19720    | 2016-10-17 13:24:17 | 0       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19720    | 2016-10-17 13:24:17 | 1       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19720    | 2016-10-17 13:24:17 | 1       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19720    | 2016-10-17 13:24:17 | 2       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19720    | 2016-10-17 13:24:17 | 2       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19720    | 2016-10-17 13:24:17 | 3       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19720    | 2016-10-17 13:24:17 | 3       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      20024    | 2016-10-17 13:33:46 | 0       | 0          | test     | t-ishii  | 2016-10-17 14:30:53 | 3            | 0            | 1            | 22055           | 1
-      20024    | 2016-10-17 13:33:46 | 0       | 1          | test     | t-ishii  | 2016-10-17 14:30:53 | 3            | 0            | 1            | 22056           | 1
-      20024    | 2016-10-17 13:33:46 | 1       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      20024    | 2016-10-17 13:33:46 | 1       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      20024    | 2016-10-17 13:33:46 | 2       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      20024    | 2016-10-17 13:33:46 | 2       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      20024    | 2016-10-17 13:33:46 | 3       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      20024    | 2016-10-17 13:33:46 | 3       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      20600    | 2016-10-17 13:46:58 | 0       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      20600    | 2016-10-17 13:46:58 | 0       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      20600    | 2016-10-17 13:46:58 | 1       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      20600    | 2016-10-17 13:46:58 | 1       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      20600    | 2016-10-17 13:46:58 | 2       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      20600    | 2016-10-17 13:46:58 | 2       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      20600    | 2016-10-17 13:46:58 | 3       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      20600    | 2016-10-17 13:46:58 | 3       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19723    | 2016-10-17 13:24:17 | 0       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19723    | 2016-10-17 13:24:17 | 0       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19723    | 2016-10-17 13:24:17 | 1       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19723    | 2016-10-17 13:24:17 | 1       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19723    | 2016-10-17 13:24:17 | 2       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19723    | 2016-10-17 13:24:17 | 2       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19723    | 2016-10-17 13:24:17 | 3       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19723    | 2016-10-17 13:24:17 | 3       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19724    | 2016-10-17 13:24:17 | 0       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19724    | 2016-10-17 13:24:17 | 0       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19724    | 2016-10-17 13:24:17 | 1       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19724    | 2016-10-17 13:24:17 | 1       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19724    | 2016-10-17 13:24:17 | 2       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19724    | 2016-10-17 13:24:17 | 2       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19724    | 2016-10-17 13:24:17 | 3       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19724    | 2016-10-17 13:24:17 | 3       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19725    | 2016-10-17 13:24:17 | 0       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19725    | 2016-10-17 13:24:17 | 0       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19725    | 2016-10-17 13:24:17 | 1       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19725    | 2016-10-17 13:24:17 | 1       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19725    | 2016-10-17 13:24:17 | 2       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19725    | 2016-10-17 13:24:17 | 2       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19725    | 2016-10-17 13:24:17 | 3       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19725    | 2016-10-17 13:24:17 | 3       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19726    | 2016-10-17 13:24:17 | 0       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19726    | 2016-10-17 13:24:17 | 0       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19726    | 2016-10-17 13:24:17 | 1       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19726    | 2016-10-17 13:24:17 | 1       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19726    | 2016-10-17 13:24:17 | 2       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19726    | 2016-10-17 13:24:17 | 2       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19726    | 2016-10-17 13:24:17 | 3       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19726    | 2016-10-17 13:24:17 | 3       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19727    | 2016-10-17 13:24:17 | 0       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19727    | 2016-10-17 13:24:17 | 0       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19727    | 2016-10-17 13:24:17 | 1       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19727    | 2016-10-17 13:24:17 | 1       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19727    | 2016-10-17 13:24:17 | 2       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19727    | 2016-10-17 13:24:17 | 2       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19727    | 2016-10-17 13:24:17 | 3       | 0          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      19727    | 2016-10-17 13:24:17 | 3       | 1          |          |          |                     | 0            | 0            | 0            | 0               | 0
-      (256 rows)
+postgres=# show pool_pools;
+ pool_pid |              start_time               | client_connection_count | pool_id | backend_id | database | username | backend_connection_time | client_connection_time | client_disconnection_time | client_idle_duration | majorversion | minorversion | pool_counter | pool_backendpid | pool_connected |       status
+----------+---------------------------------------+-------------------------+---------+------------+----------+----------+-------------------------+------------------------+---------------------------+----------------------+--------------+--------------+--------------+-----------------+----------------+---------------------
+ 3727     | 2021-09-07 02:29:38 (remaining: 5:00) | 0                       | 0       | 0          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Wait for connection
+ 3727     | 2021-09-07 02:29:38 (remaining: 5:00) | 0                       | 0       | 1          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Wait for connection
+ 3727     | 2021-09-07 02:29:38 (remaining: 5:00) | 0                       | 1       | 0          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Wait for connection
+ 3727     | 2021-09-07 02:29:38 (remaining: 5:00) | 0                       | 1       | 1          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Wait for connection
+ 3727     | 2021-09-07 02:29:38 (remaining: 5:00) | 0                       | 2       | 0          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Wait for connection
+ 3727     | 2021-09-07 02:29:38 (remaining: 5:00) | 0                       | 2       | 1          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Wait for connection
+ 3727     | 2021-09-07 02:29:38 (remaining: 5:00) | 0                       | 3       | 0          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Wait for connection
+ 3727     | 2021-09-07 02:29:38 (remaining: 5:00) | 0                       | 3       | 1          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Wait for connection
+ 3728     | 2021-09-07 02:29:38 (remaining: 5:00) | 0                       | 0       | 0          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Wait for connection
+ 3728     | 2021-09-07 02:29:38 (remaining: 5:00) | 0                       | 0       | 1          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Wait for connection
+ 3728     | 2021-09-07 02:29:38 (remaining: 5:00) | 0                       | 1       | 0          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Wait for connection
+ 3728     | 2021-09-07 02:29:38 (remaining: 5:00) | 0                       | 1       | 1          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Wait for connection
+ 3728     | 2021-09-07 02:29:38 (remaining: 5:00) | 0                       | 2       | 0          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Wait for connection
+ 3728     | 2021-09-07 02:29:38 (remaining: 5:00) | 0                       | 2       | 1          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Wait for connection
+ 3728     | 2021-09-07 02:29:38 (remaining: 5:00) | 0                       | 3       | 0          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Wait for connection
+ 3728     | 2021-09-07 02:29:38 (remaining: 5:00) | 0                       | 3       | 1          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Wait for connection
+ 3729     | 2021-09-07 02:29:38 (remaining: 3:30) | 1                       | 0       | 0          | postgres | postgres | 2021-09-07 02:29:47     | 2021-09-07 02:29:47    | 2021-09-07 02:29:46       | 90                   | 3            | 0            | 1            | 3749            | 1              | Idle
+ 3729     | 2021-09-07 02:29:38 (remaining: 3:30) | 1                       | 0       | 1          | postgres | postgres | 2021-09-07 02:29:47     | 2021-09-07 02:29:47    | 2021-09-07 02:29:46       | 0                    | 3            | 0            | 1            | 3750            | 1              | Idle
+ 3729     | 2021-09-07 02:29:38 (remaining: 3:30) | 1                       | 1       | 0          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Idle
+ 3729     | 2021-09-07 02:29:38 (remaining: 3:30) | 1                       | 1       | 1          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Idle
+ 3729     | 2021-09-07 02:29:38 (remaining: 3:30) | 1                       | 2       | 0          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Idle
+ 3729     | 2021-09-07 02:29:38 (remaining: 3:30) | 1                       | 2       | 1          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Idle
+ 3729     | 2021-09-07 02:29:38 (remaining: 3:30) | 1                       | 3       | 0          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Idle
+ 3729     | 2021-09-07 02:29:38 (remaining: 3:30) | 1                       | 3       | 1          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Idle
+ 3730     | 2021-09-07 02:29:38 (remaining: 5:00) | 0                       | 0       | 0          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Wait for connection
+ 3730     | 2021-09-07 02:29:38 (remaining: 5:00) | 0                       | 0       | 1          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Wait for connection
+ 3730     | 2021-09-07 02:29:38 (remaining: 5:00) | 0                       | 1       | 0          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Wait for connection
+ 3730     | 2021-09-07 02:29:38 (remaining: 5:00) | 0                       | 1       | 1          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Wait for connection
+ 3730     | 2021-09-07 02:29:38 (remaining: 5:00) | 0                       | 2       | 0          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Wait for connection
+ 3730     | 2021-09-07 02:29:38 (remaining: 5:00) | 0                       | 2       | 1          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Wait for connection
+ 3730     | 2021-09-07 02:29:38 (remaining: 5:00) | 0                       | 3       | 0          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Wait for connection
+ 3730     | 2021-09-07 02:29:38 (remaining: 5:00) | 0                       | 3       | 1          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Wait for connection
+ 3731     | 2021-09-07 02:29:38 (remaining: 5:00) | 0                       | 0       | 0          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Wait for connection
+ 3731     | 2021-09-07 02:29:38 (remaining: 5:00) | 0                       | 0       | 1          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Wait for connection
+ 3731     | 2021-09-07 02:29:38 (remaining: 5:00) | 0                       | 1       | 0          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Wait for connection
+ 3731     | 2021-09-07 02:29:38 (remaining: 5:00) | 0                       | 1       | 1          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Wait for connection
+ 3731     | 2021-09-07 02:29:38 (remaining: 5:00) | 0                       | 2       | 0          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Wait for connection
+ 3731     | 2021-09-07 02:29:38 (remaining: 5:00) | 0                       | 2       | 1          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Wait for connection
+ 3731     | 2021-09-07 02:29:38 (remaining: 5:00) | 0                       | 3       | 0          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Wait for connection
+ 3731     | 2021-09-07 02:29:38 (remaining: 5:00) | 0                       | 3       | 1          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Wait for connection
+ 3732     | 2021-09-07 02:29:38 (remaining: 5:00) | 0                       | 0       | 0          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Wait for connection
+ 3732     | 2021-09-07 02:29:38 (remaining: 5:00) | 0                       | 0       | 1          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Wait for connection
+ 3732     | 2021-09-07 02:29:38 (remaining: 5:00) | 0                       | 1       | 0          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Wait for connection
+ 3732     | 2021-09-07 02:29:38 (remaining: 5:00) | 0                       | 1       | 1          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Wait for connection
+ 3732     | 2021-09-07 02:29:38 (remaining: 5:00) | 0                       | 2       | 0          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Wait for connection
+ 3732     | 2021-09-07 02:29:38 (remaining: 5:00) | 0                       | 2       | 1          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Wait for connection
+ 3732     | 2021-09-07 02:29:38 (remaining: 5:00) | 0                       | 3       | 0          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Wait for connection
+ 3732     | 2021-09-07 02:29:38 (remaining: 5:00) | 0                       | 3       | 1          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Wait for connection
+ 3733     | 2021-09-07 02:29:38 (remaining: 5:00) | 0                       | 0       | 0          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Wait for connection
+ 3733     | 2021-09-07 02:29:38 (remaining: 5:00) | 0                       | 0       | 1          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Wait for connection
+ 3733     | 2021-09-07 02:29:38 (remaining: 5:00) | 0                       | 1       | 0          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Wait for connection
+ 3733     | 2021-09-07 02:29:38 (remaining: 5:00) | 0                       | 1       | 1          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Wait for connection
+ 3733     | 2021-09-07 02:29:38 (remaining: 5:00) | 0                       | 2       | 0          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Wait for connection
+ 3733     | 2021-09-07 02:29:38 (remaining: 5:00) | 0                       | 2       | 1          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Wait for connection
+ 3733     | 2021-09-07 02:29:38 (remaining: 5:00) | 0                       | 3       | 0          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Wait for connection
+ 3733     | 2021-09-07 02:29:38 (remaining: 5:00) | 0                       | 3       | 1          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Wait for connection
+ 3734     | 2021-09-07 02:29:38 (remaining: 5:00) | 4                       | 0       | 0          | postgres | postgres | 2021-09-07 02:31:22     | 2021-09-07 02:31:22    | 2021-09-07 02:31:15       | 0                    | 3            | 0            | 1            | 3823            | 1              | Execute command
+ 3734     | 2021-09-07 02:29:38 (remaining: 5:00) | 4                       | 0       | 1          | postgres | postgres | 2021-09-07 02:31:22     | 2021-09-07 02:31:22    | 2021-09-07 02:31:15       | 0                    | 3            | 0            | 1            | 3824            | 1              | Execute command
+ 3734     | 2021-09-07 02:29:38 (remaining: 5:00) | 4                       | 1       | 0          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Execute command
+ 3734     | 2021-09-07 02:29:38 (remaining: 5:00) | 4                       | 1       | 1          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Execute command
+ 3734     | 2021-09-07 02:29:38 (remaining: 5:00) | 4                       | 2       | 0          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Execute command
+ 3734     | 2021-09-07 02:29:38 (remaining: 5:00) | 4                       | 2       | 1          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Execute command
+ 3734     | 2021-09-07 02:29:38 (remaining: 5:00) | 4                       | 3       | 0          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Execute command
+ 3734     | 2021-09-07 02:29:38 (remaining: 5:00) | 4                       | 3       | 1          |          |          |                         |                        |                           | 0                    | 0            | 0            | 0            | 0               | 0              | Execute command
+(64 rows)
      </programlisting>
 
   </para>
index 30cae796988c8a2c480fa1de4d5190a510ada46b..303673703526df68d1be05fc0d34c80e3ee61f18 100644 (file)
@@ -37,7 +37,7 @@
    connections and dealing with a connection.
   </para>
   <para>
-   It has 6 columns:
+   It has 8 columns:
    <itemizedlist>
     <listitem>
      <para>
      <para>
       <literal>start_time</literal> is the timestamp of when
       this process was launched.
+      <itemizedlist>
+       <listitem>
+        <para>
+         <literal>remaining</literal> is the remaining time by
+         <xref linkend="guc-client-idle-limit">. If
+         <literal>client_idle_limit</literal> is set 0,
+         <literal>remaining</literal> is not desplayed.
+        </para>
+       </listitem>
+      </itemizedlist>
+     </para>
+    </listitem>
+    <listitem>
+     <para>
+      <literal>client_connection_count</literal> counts the number of times
+      this process has been used by clients.
      </para>
     </listitem>
     <listitem>
@@ -66,7 +82,7 @@
     </listitem>
     <listitem>
      <para>
-      <literal>create_time</literal> is the creation time and
+      <literal>backend_connection_time</literal> is the creation time and
       date of the connection.
      </para>
     </listitem>
       clients.
      </para>
     </listitem>
+    <listitem>
+     <para>
+      <literal>status</literal> is current status of this process. Possible values are:
+        <itemizedlist>
+          <listitem>
+            <para>
+              <literal>Execute command</literal>: Executing a command.
+            </para>
+          </listitem>
+          <listitem>
+            <para>
+              <literal>Idle</literal>: The process is waiting for a new client command.
+            </para>
+          </listitem>
+          <listitem>
+            <para>
+              <literal>Idle</literal>: The process is waiting for a new client command
+              in a transaction.
+            </para>
+          </listitem>
+          <listitem>
+            <para>
+              <literal>Wait for connection</literal>: The process is waiting for a new client connection.
+            </para>
+          </listitem>
+      </itemizedlist>
+     </para>
+    </listitem>
    </itemizedlist>
   </para>
   <para>
    Here is an example session:
    <programlisting>
-    test=# show pool_processes;
-    pool_pid |     start_time      | database | username |     create_time     | pool_counter
-    ----------+---------------------+----------+----------+---------------------+--------------
-    19696    | 2016-10-17 13:24:17 | postgres | t-ishii  | 2016-10-17 13:35:12 | 1
-    19697    | 2016-10-17 13:24:17 |          |          |                     |
-    19698    | 2016-10-17 13:24:17 |          |          |                     |
-    19699    | 2016-10-17 13:24:17 |          |          |                     |
-    19700    | 2016-10-17 13:24:17 |          |          |                     |
-    19701    | 2016-10-17 13:24:17 |          |          |                     |
-    19702    | 2016-10-17 13:24:17 |          |          |                     |
-    19703    | 2016-10-17 13:24:17 |          |          |                     |
-    19704    | 2016-10-17 13:24:17 |          |          |                     |
-    19705    | 2016-10-17 13:24:17 |          |          |                     |
-    19706    | 2016-10-17 13:24:17 |          |          |                     |
-    19707    | 2016-10-17 13:24:17 |          |          |                     |
-    19708    | 2016-10-17 13:24:17 |          |          |                     |
-    19709    | 2016-10-17 13:24:17 |          |          |                     |
-    19710    | 2016-10-17 13:24:17 |          |          |                     |
-    19711    | 2016-10-17 13:24:17 |          |          |                     |
-    19712    | 2016-10-17 13:24:17 |          |          |                     |
-    19713    | 2016-10-17 13:24:17 |          |          |                     |
-    19714    | 2016-10-17 13:24:17 |          |          |                     |
-    19715    | 2016-10-17 13:24:17 |          |          |                     |
-    19716    | 2016-10-17 13:24:17 |          |          |                     |
-    19717    | 2016-10-17 13:24:17 |          |          |                     |
-    19718    | 2016-10-17 13:24:17 |          |          |                     |
-    19719    | 2016-10-17 13:24:17 |          |          |                     |
-    19720    | 2016-10-17 13:24:17 |          |          |                     |
-    20024    | 2016-10-17 13:33:46 |          |          |                     |
-    19722    | 2016-10-17 13:24:17 | test     | t-ishii  | 2016-10-17 13:34:42 | 1
-    19723    | 2016-10-17 13:24:17 |          |          |                     |
-    19724    | 2016-10-17 13:24:17 |          |          |                     |
-    19725    | 2016-10-17 13:24:17 |          |          |                     |
-    19726    | 2016-10-17 13:24:17 |          |          |                     |
-    19727    | 2016-10-17 13:24:17 |          |          |                     |
-    (32 rows)
+postgres=# show pool_processes;
+ pool_pid |              start_time               | client_connection_count | database | username | backend_connection_time | pool_counter |       status
+----------+---------------------------------------+-------------------------+----------+----------+-------------------------+--------------+---------------------
+ 6685     | 2021-09-07 02:41:13 (remaining: 5:00) | 0                       |          |          |                         |              | Wait for connection
+ 6686     | 2021-09-07 02:41:13 (remaining: 5:00) | 0                       |          |          |                         |              | Wait for connection
+ 6687     | 2021-09-07 02:41:13 (remaining: 5:00) | 0                       |          |          |                         |              | Wait for connection
+ 6688     | 2021-09-07 02:41:13 (remaining: 4:10) | 1                       | postgres | postgres | 2021-09-07 02:41:48     | 1            | Idle
+ 6689     | 2021-09-07 02:41:13 (remaining: 5:00) | 0                       |          |          |                         |              | Wait for connection
+ 6690     | 2021-09-07 02:41:13 (remaining: 5:00) | 0                       |          |          |                         |              | Wait for connection
+ 6691     | 2021-09-07 02:41:13 (remaining: 5:00) | 0                       |          |          |                         |              | Wait for connection
+ 6692     | 2021-09-07 02:41:13 (remaining: 5:00) | 2                       | postgres | postgres | 2021-09-07 02:42:38     | 1            | Execute command
+(8 rows)
    </programlisting>
   </para>
  </refsect1>
index 6e6402cfad516cbed6ceefaa29521f1e8c78fa4f..51b08bed22d8509de0af0438555e3bed776e55dc 100644 (file)
@@ -292,6 +292,7 @@ pool_coninfo_set_frontend_connected(int proc_id, int pool_index)
                        return;
                }
                con->connected = true;
+               con->client_connection_time = time(NULL);
        }
 }
 
@@ -317,6 +318,7 @@ pool_coninfo_unset_frontend_connected(int proc_id, int pool_index)
                        return;
                }
                con->connected = false;
+               con->client_disconnection_time = time(NULL);
        }
 }
 
index b62c3b2845f25b73908478c4b015fe95c40396a9..acf94076e3b048dd59d109b387a147d911e509c5 100644 (file)
@@ -118,6 +118,14 @@ typedef struct
        BackendInfo backend_info[MAX_NUM_BACKENDS];
 }                      BackendDesc;
 
+typedef enum
+{
+       WAIT_FOR_CONNECT,
+       COMMAND_EXECUTE,
+       IDLE,
+       IDLE_IN_TRANS
+}                      ProcessStatus;
+
 /*
  * Connection pool information. Placed on shared memory area.
  */
@@ -132,6 +140,9 @@ typedef struct
        int                     key;                    /* cancel key */
        int                     counter;                /* used counter */
        time_t          create_time;    /* connection creation time */
+       time_t          client_connection_time; /* client connection time */
+       time_t          client_disconnection_time;      /* client last disconnection time */
+       int                     client_idle_duration;   /* client idle duration time (s) */
        int                     load_balancing_node;    /* load balancing node */
        char            connected;              /* True if frontend connected. Please note
                                                                 * that we use "char" instead of "bool". Since
@@ -160,6 +171,8 @@ typedef struct
        time_t          start_time;             /* fork() time */
        ConnectionInfo *connection_info;        /* head of the connection info for
                                                                                 * this process */
+       int                     client_connection_count;        /* how many times clients used this process */
+       ProcessStatus   status;
        char            need_to_restart;        /* If non 0, exit this child process as
                                                                         * soon as current session ends. Typical
                                                                         * case this flag being set is failback a
@@ -181,7 +194,7 @@ typedef struct
 #define POOLCONFIG_MAXDATELEN 128
 #define POOLCONFIG_MAXCOUNTLEN 16
 #define POOLCONFIG_MAXLONGCOUNTLEN 20
-
+#define POOLCONFIG_MAXPROCESSSTATUSLEN 20
 /* config report struct*/
 typedef struct
 {
@@ -213,28 +226,35 @@ typedef struct
 typedef struct
 {
        char            pool_pid[POOLCONFIG_MAXCOUNTLEN + 1];
-       char            start_time[POOLCONFIG_MAXDATELEN + 1];
+       char            process_start_time[POOLCONFIG_MAXDATELEN + 1];
+       char            client_connection_count[POOLCONFIG_MAXCOUNTLEN + 1];
        char            database[POOLCONFIG_MAXIDENTLEN + 1];
        char            username[POOLCONFIG_MAXIDENTLEN + 1];
-       char            create_time[POOLCONFIG_MAXDATELEN + 1];
+       char            backend_connection_time[POOLCONFIG_MAXDATELEN + 1];
        char            pool_counter[POOLCONFIG_MAXCOUNTLEN + 1];
+       char            status[POOLCONFIG_MAXPROCESSSTATUSLEN + 1];
 }                      POOL_REPORT_PROCESSES;
 
 /* pools reporting struct */
 typedef struct
 {
        char            pool_pid[POOLCONFIG_MAXCOUNTLEN + 1];
-       char            start_time[POOLCONFIG_MAXDATELEN + 1];
+       char            process_start_time[POOLCONFIG_MAXDATELEN + 1];
+       char            client_connection_count[POOLCONFIG_MAXCOUNTLEN + 1];
        char            pool_id[POOLCONFIG_MAXCOUNTLEN + 1];
        char            backend_id[POOLCONFIG_MAXCOUNTLEN + 1];
        char            database[POOLCONFIG_MAXIDENTLEN + 1];
        char            username[POOLCONFIG_MAXIDENTLEN + 1];
-       char            create_time[POOLCONFIG_MAXDATELEN + 1];
+       char            backend_connection_time[POOLCONFIG_MAXDATELEN + 1];
+       char            client_connection_time[POOLCONFIG_MAXDATELEN + 1];
+       char            client_disconnection_time[POOLCONFIG_MAXDATELEN + 1];
+       char            client_idle_duration[POOLCONFIG_MAXCOUNTLEN + 1];
        char            pool_majorversion[POOLCONFIG_MAXCOUNTLEN + 1];
        char            pool_minorversion[POOLCONFIG_MAXCOUNTLEN + 1];
        char            pool_counter[POOLCONFIG_MAXCOUNTLEN + 1];
        char            pool_backendpid[POOLCONFIG_MAXCOUNTLEN + 1];
        char            pool_connected[POOLCONFIG_MAXCOUNTLEN + 1];
+       char            status[POOLCONFIG_MAXPROCESSSTATUSLEN + 1];
 }                      POOL_REPORT_POOLS;
 
 /* version struct */
index d15a0a13e6530ba1918d00fcf51a6f0464d5a931..940ba399ec67ff5c12218354ccbd8ca397d2c675 100644 (file)
@@ -619,7 +619,7 @@ extern int  send_to_pg_frontend(char *data, int len, bool flush);
 extern int     pg_frontend_exists(void);
 extern int     set_pg_frontend_blocking(bool blocking);
 extern int     get_frontend_protocol_version(void);
-
+extern void set_process_status(ProcessStatus status);
 
 /*pool_shmem.c*/
 extern void *pool_shared_memory_create(size_t size);
index c4453a76428369f576ae2c7bcb919a6507d8a9fe..45039c3de969534861ac546c005e9bdc21381dc7 100644 (file)
@@ -409,6 +409,8 @@ PgpoolMain(bool discard_status, bool clear_memcache_oidmaps)
        {
                process_info[i].pid = fork_a_child(fds, i);
                process_info[i].start_time = time(NULL);
+               process_info[i].client_connection_count = 0;
+               process_info[i].status = WAIT_FOR_CONNECT;
        }
 
        /* create pipe for delivering event */
@@ -2022,6 +2024,8 @@ failover(void)
 
                                                process_info[i].pid = fork_a_child(fds, i);
                                                process_info[i].start_time = time(NULL);
+                                               process_info[i].client_connection_count = 0;
+                                               process_info[i].status = WAIT_FOR_CONNECT;
                                        }
                                }
                                else
@@ -2489,6 +2493,8 @@ reaper(void)
                                                process_info[i].pid = fork_a_child(fds, i);
                                                process_info[i].start_time = time(NULL);
                                                new_pid = process_info[i].pid;
+                                               process_info[i].client_connection_count = 0;
+                                               process_info[i].status = WAIT_FOR_CONNECT;
                                        }
                                        else
                                                process_info[i].pid = 0;
@@ -4242,6 +4248,8 @@ sync_backend_from_watchdog(void)
 
                                        process_info[i].pid = fork_a_child(fds, i);
                                        process_info[i].start_time = time(NULL);
+                                       process_info[i].client_connection_count = 0;
+                                       process_info[i].status = WAIT_FOR_CONNECT;
                                }
                        }
                        else
index 4fb6f770911940927d36ffbb1a23b834ca991715..427c809a28c5670c7bee729bd349a4a56166b16a 100644 (file)
@@ -162,6 +162,8 @@ do_child(int *fds)
        ereport(DEBUG2,
                        (errmsg("I am Pgpool Child process with pid: %d", getpid())));
 
+       ProcessInfo* proc_info = pool_get_process_info(getpid());
+
        /* Identify myself via ps */
        init_ps_display("", "", "", "");
 
@@ -284,6 +286,8 @@ do_child(int *fds)
                        if (pool_config->child_max_connections > 0)
                                connections_count++;
 
+                       proc_info->client_connection_count++;
+
                        /* check if maximum connections count for this child reached */
                        if ((pool_config->child_max_connections > 0) &&
                                (connections_count >= pool_config->child_max_connections))
@@ -410,6 +414,7 @@ do_child(int *fds)
                snprintf(psbuf, sizeof(psbuf), "%s %s %s idle",
                                 sp->user, sp->database, remote_ps_data);
                set_ps_display(psbuf, false);
+               set_process_status(IDLE);
 
                /*
                 * Initialize per session context
@@ -468,6 +473,8 @@ do_child(int *fds)
                if (pool_config->child_max_connections > 0)
                        connections_count++;
 
+               proc_info->client_connection_count++;
+
                /* check if maximum connections count for this child reached */
                if ((pool_config->child_max_connections > 0) &&
                        (connections_count >= pool_config->child_max_connections))
@@ -1481,6 +1488,8 @@ wait_for_new_connections(int *fds, struct timeval *timeout, SockAddr *saddr)
        else
                set_ps_display("wait for connection request", false);
 
+       set_process_status(WAIT_FOR_CONNECT);
+
        memcpy((char *) &rmask, (char *) &readmask, sizeof(fd_set));
 
        if (timeout->tv_sec == 0 && timeout->tv_usec == 0)
@@ -1551,6 +1560,7 @@ wait_for_new_connections(int *fds, struct timeval *timeout, SockAddr *saddr)
                }
 
                set_ps_display("wait for connection request", false);
+               set_process_status(WAIT_FOR_CONNECT);
                ereport(DEBUG1,
                                (errmsg("LOCKING select()")));
        }
@@ -2124,3 +2134,10 @@ static int opt_sort(const void *a, const void *b)
 {
        return strcmp( *(char **)a, *(char **)b);
 }
+
+void
+set_process_status(ProcessStatus status)
+{
+       ProcessInfo* proc_info = pool_get_process_info(getpid());
+       proc_info->status = status;
+}
\ No newline at end of file
index e84822eadc613cba41fcff0a7f634afd58bb635f..ed28d87001bd80721a8e07d03297878dfde4521f 100644 (file)
@@ -968,6 +968,7 @@ static POOL_CONNECTION_POOL * new_connection(POOL_CONNECTION_POOL * p)
                else
                {
                        p->info[i].create_time = time(NULL);
+                       p->info[i].client_idle_duration = 0;
                        p->slots[i] = s;
 
                        pool_init_params(&s->con->params);
index 898c5585877b519ccd735a1c17c987c34b9069e9..0e4bfa02f117ca1383c35ebbbbd250d353cb510a 100644 (file)
@@ -238,6 +238,7 @@ pool_process_query(POOL_CONNECTION * frontend,
                        bool            cont = true;
 
                        status = read_packets_and_process(frontend, backend, reset_request, &state, &num_fields, &cont);
+                       backend->info->client_idle_duration = 0;
                        if (status != POOL_CONTINUE)
                                return status;
                        else if (!cont)         /* Detected admin shutdown */
@@ -289,6 +290,7 @@ pool_process_query(POOL_CONNECTION * frontend,
                                        bool            cont = true;
 
                                        status = read_packets_and_process(frontend, backend, reset_request, &state, &num_fields, &cont);
+                                       backend->info->client_idle_duration = 0;
                                        if (status != POOL_CONTINUE)
                                                return status;
                                        else if (!cont) /* Detected admin shutdown */
@@ -3862,6 +3864,7 @@ query_ps_status(char *query, POOL_CONNECTION_POOL * backend)
        psbuf[i] = '\0';
 
        set_ps_display(psbuf, false);
+       set_process_status(COMMAND_EXECUTE);
 }
 
 /* compare function for bsearch() */
@@ -4751,6 +4754,7 @@ SELECT_RETRY:
        /* select timeout */
        if (fds == 0)
        {
+               backend->info->client_idle_duration++;
                if (*InRecovery == RECOVERY_INIT && pool_config->client_idle_limit > 0)
                {
                        idle_count++;
index af1c08bdf98068e80aff4d0c6ab07d02c52f7aa6..235fcf67f6cdd9932b5a3fc68db70148bee25faa 100644 (file)
@@ -701,14 +701,16 @@ output_procinfo_result(PCPResultInfo * pcpResInfo, bool all, bool verbose)
        int                     array_size = pcp_result_slot_count(pcpResInfo);
 
        const char *titles[] = {
-               "Database", "Username", "Start time", "Creation time", 
-               "Major", "Minor", "Counter", "Backend PID",
-               "Connected", "PID", "Backend ID"
+               "Database", "Username", "Start time", "Client connection count",
+               "Major", "Minor", "Backend connection time", "Client connection time",
+               "Client idle duration", "Client disconnection time", "Pool Counter", "Backend PID",
+               "Connected", "PID", "Backend ID", "Status"
        };
        const char *types[] = {
                "s", "s", "s", "s",
                "s", "s", "s", "s",
-               "s", "s", "s"
+               "s", "s", "s", "s",
+               "s", "s", "s", "s"
        };
 
 
@@ -716,7 +718,7 @@ output_procinfo_result(PCPResultInfo * pcpResInfo, bool all, bool verbose)
                format = format_titles(titles, types, sizeof(titles)/sizeof(char *));
        else
        {
-               format = "%s %s %s %s %s %s %s %s %s %s %s\n";
+               format = "%s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s\n";
        }
 
        for (i = 0; i < array_size; i++)
@@ -732,15 +734,20 @@ output_procinfo_result(PCPResultInfo * pcpResInfo, bool all, bool verbose)
                printf(format,
                           pools->database,
                           pools->username,
-                          pools->start_time,
-                          pools->create_time,
+                          pools->process_start_time,
+                          pools->client_connection_count,
                           pools->pool_majorversion,
                           pools->pool_minorversion,
+                          pools->backend_connection_time,
+                          pools->client_connection_time,
+                          pools->client_idle_duration,
+                          pools->client_disconnection_time,
                           pools->pool_counter,
                           pools->pool_backendpid,
                           pools->pool_connected,
                           pools->pool_pid,
-                          pools->backend_id);
+                          pools->backend_id,
+                          pools->status);
        }
        if (printed == false)
                printf("No process information available\n\n");
index b90fd5cc235e691159b96ca0789b76af4b7e8526..b062ed25dfb77ad07ca01e21c676aaea527e6e43 100644 (file)
@@ -69,17 +69,22 @@ int * pool_report_pools_offsets(int *n)
 
        static int offsettbl[] = {
                offsetof(POOL_REPORT_POOLS, pool_pid),
-               offsetof(POOL_REPORT_POOLS, start_time),
+               offsetof(POOL_REPORT_POOLS, process_start_time),
+               offsetof(POOL_REPORT_POOLS, client_connection_count),
                offsetof(POOL_REPORT_POOLS, pool_id),
                offsetof(POOL_REPORT_POOLS, backend_id),
                offsetof(POOL_REPORT_POOLS, database),
                offsetof(POOL_REPORT_POOLS, username),
-               offsetof(POOL_REPORT_POOLS, create_time),
+               offsetof(POOL_REPORT_POOLS, backend_connection_time),
+               offsetof(POOL_REPORT_POOLS, client_connection_time),
+               offsetof(POOL_REPORT_POOLS, client_disconnection_time),
+               offsetof(POOL_REPORT_POOLS, client_idle_duration),
                offsetof(POOL_REPORT_POOLS, pool_majorversion),
                offsetof(POOL_REPORT_POOLS, pool_minorversion),
                offsetof(POOL_REPORT_POOLS, pool_counter),
                offsetof(POOL_REPORT_POOLS, pool_backendpid),
-               offsetof(POOL_REPORT_POOLS, pool_connected)
+               offsetof(POOL_REPORT_POOLS, pool_connected),
+               offsetof(POOL_REPORT_POOLS, status)
        };
 
        *n = sizeof(offsettbl)/sizeof(int);
index 78a292762784becaf2a479291df1d7b0671667f1..1bfc2e4a4196184dae14e0636e4f2f994ee60cc2 100644 (file)
@@ -1419,6 +1419,20 @@ get_pools(int *nrows)
                proc_id = process_info[child].pid;
                pi = pool_get_process_info(proc_id);
 
+               int remaining_time = pool_config->client_idle_limit;
+               if (pool_config->client_idle_limit)
+               {
+                       for (pool = 0; pool < pool_config->max_pool; pool++)
+                       {
+                               for (backend_id = 0; backend_id < NUM_BACKENDS; backend_id++)
+                               {
+                                       poolBE = pool * MAX_NUM_BACKENDS + backend_id;
+                                       if (pi->connection_info[poolBE].client_idle_duration > 0)
+                                               remaining_time = pool_config->client_idle_limit - pi->connection_info[poolBE].client_idle_duration;
+                               }
+                       }
+               }
+
                for (pool = 0; pool < pool_config->max_pool; pool++)
                {
                        for (backend_id = 0; backend_id < NUM_BACKENDS; backend_id++)
@@ -1427,20 +1441,59 @@ get_pools(int *nrows)
                                snprintf(pools[lines].pool_pid, sizeof(pools[lines].pool_pid), "%d", proc_id);
 
                                if (pi->start_time)
-                                       strftime(pools[lines].start_time, sizeof(pools[lines].start_time), "%Y-%m-%d %H:%M:%S",
-                                                        localtime(&pi->start_time));
+                               {
+                                       if (pool_config->client_idle_limit)
+                                       {
+                                               char proc_start_time[POOLCONFIG_MAXDATELEN + 1];
+                                               strftime(proc_start_time, sizeof(proc_start_time),
+                                                                "%Y-%m-%d %H:%M:%S", localtime(&pi->start_time));
+                                               snprintf(pools[lines].process_start_time, sizeof(pools[lines].process_start_time),
+                                                                "%s (remaining: %d:%02d)", proc_start_time,
+                                                                remaining_time / 60,
+                                                                remaining_time % 60);
+                                       }
+                                       else
+                                       {
+                                               strftime(pools[lines].process_start_time, sizeof(pools[lines].process_start_time),
+                                                                "%Y-%m-%d %H:%M:%S", localtime(&pi->start_time));
+                                       }
+                               }
                                else
-                                       *(pools[lines].start_time) = '\0';
+                                       *(pools[lines].process_start_time) = '\0';
 
                                snprintf(pools[lines].pool_id, sizeof(pools[lines].pool_id), "%d", pool);
 
                                snprintf(pools[lines].backend_id, sizeof(pools[lines].backend_id), "%d", backend_id);
 
+                               snprintf(pools[lines].client_connection_count, sizeof(pools[lines].client_connection_count),
+                                                "%d", pi->client_connection_count);
+
+                               if (pi->connection_info[poolBE].client_connection_time == 0){
+                                       *(pools[lines].client_connection_time) = '\0';
+                               }
+                               else
+                               {
+                                       strftime(pools[lines].client_connection_time, sizeof(pools[lines].client_connection_time),
+                                                "%Y-%m-%d %H:%M:%S", localtime(&pi->connection_info[poolBE].client_connection_time));
+                               }
+
+                               if (pi->connection_info[poolBE].client_disconnection_time == 0){
+                                       *(pools[lines].client_disconnection_time) = '\0';
+                               }
+                               else
+                               {
+                                       strftime(pools[lines].client_disconnection_time, sizeof(pools[lines].client_disconnection_time),
+                                                "%Y-%m-%d %H:%M:%S", localtime(&pi->connection_info[poolBE].client_disconnection_time));
+                               }
+
+                               snprintf(pools[lines].client_idle_duration, sizeof(pools[lines].client_idle_duration), "%d",
+                                                pi->connection_info[poolBE].client_idle_duration);
+
                                if (strlen(pi->connection_info[poolBE].database) == 0)
                                {
                                        StrNCpy(pools[lines].database, "", POOLCONFIG_MAXIDENTLEN);
                                        StrNCpy(pools[lines].username, "", POOLCONFIG_MAXIDENTLEN);
-                                       *(pools[lines].create_time) = '\0';
+                                       *(pools[lines].backend_connection_time) = '\0';
                                        snprintf(pools[lines].pool_majorversion, sizeof(pools[lines].pool_majorversion), "%d", 0);
                                        snprintf(pools[lines].pool_minorversion, sizeof(pools[lines].pool_minorversion), "%d", 0);
                                }
@@ -1448,8 +1501,8 @@ get_pools(int *nrows)
                                {
                                        StrNCpy(pools[lines].database, pi->connection_info[poolBE].database, POOLCONFIG_MAXIDENTLEN);
                                        StrNCpy(pools[lines].username, pi->connection_info[poolBE].user, POOLCONFIG_MAXIDENTLEN);
-                                       strftime(pools[lines].create_time, sizeof(pools[lines].create_time), "%Y-%m-%d %H:%M:%S",
-                                                        localtime(&pi->connection_info[poolBE].create_time));
+                                       strftime(pools[lines].backend_connection_time, sizeof(pools[lines].backend_connection_time),
+                                                        "%Y-%m-%d %H:%M:%S", localtime(&pi->connection_info[poolBE].create_time));
                                        snprintf(pools[lines].pool_majorversion, sizeof(pools[lines].pool_majorversion), "%d",
                                                         pi->connection_info[poolBE].major);
                                        snprintf(pools[lines].pool_minorversion, sizeof(pools[lines].pool_minorversion), "%d",
@@ -1462,6 +1515,24 @@ get_pools(int *nrows)
                                snprintf(pools[lines].pool_connected, sizeof(pools[lines].pool_connected), "%d",
                                                 pi->connection_info[poolBE].connected);
 
+                               switch(pi->status)
+                               {
+                                       case WAIT_FOR_CONNECT:
+                                               StrNCpy(pools[lines].status, "Wait for connection", POOLCONFIG_MAXPROCESSSTATUSLEN);
+                                               break;
+                                       case COMMAND_EXECUTE:
+                                               StrNCpy(pools[lines].status, "Execute command", POOLCONFIG_MAXPROCESSSTATUSLEN);
+                                               break;
+                                       case IDLE:
+                                               StrNCpy(pools[lines].status, "Idle", POOLCONFIG_MAXPROCESSSTATUSLEN);
+                                               break;
+                                       case IDLE_IN_TRANS:
+                                               StrNCpy(pools[lines].status, "Idle in transaction", POOLCONFIG_MAXPROCESSSTATUSLEN);
+                                               break;
+                                       default:
+                                               *(pools[lines].status) = '\0';
+                               }
+
                                lines++;
                        }
                }
@@ -1478,8 +1549,10 @@ void
 pools_reporting(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend)
 {
        short num_fields;
-       static char *field_names[] = {"pool_pid", "start_time", "pool_id", "backend_id", "database", "username", "create_time",
-                                                                 "majorversion", "minorversion", "pool_counter", "pool_backendpid", "pool_connected"};
+       static char *field_names[] = {"pool_pid", "start_time", "client_connection_count", "pool_id",
+                                                                 "backend_id", "database", "username", "backend_connection_time",
+                                                                 "client_connection_time", "client_disconnection_time", "client_idle_duration",
+                                                                 "majorversion", "minorversion", "pool_counter", "pool_backendpid", "pool_connected", "status"};
        int             n;
        int             *offsettbl;
        int             nrows;
@@ -1511,11 +1584,42 @@ get_processes(int *nrows)
                proc_id = process_info[child].pid;
                pi = pool_get_process_info(proc_id);
 
+               int remaining_time = pool_config->client_idle_limit;
+               if (pool_config->client_idle_limit)
+               {
+                       int backend_id;
+                       for (pool = 0; pool < pool_config->max_pool; pool++)
+                       {
+                               for (backend_id = 0; backend_id < NUM_BACKENDS; backend_id++)
+                               {
+                                       poolBE = pool * MAX_NUM_BACKENDS + backend_id;
+                                       if (pi->connection_info[poolBE].client_idle_duration > 0)
+                                               remaining_time = pool_config->client_idle_limit - pi->connection_info[poolBE].client_idle_duration;
+                               }
+                       }
+               }
+
                snprintf(processes[child].pool_pid, POOLCONFIG_MAXCOUNTLEN, "%d", proc_id);
-               strftime(processes[child].start_time, POOLCONFIG_MAXDATELEN, "%Y-%m-%d %H:%M:%S", localtime(&pi->start_time));
+               if (pool_config->client_idle_limit)
+               {
+                       char proc_start_time[POOLCONFIG_MAXDATELEN + 1];
+                       strftime(proc_start_time, sizeof(proc_start_time),
+                                        "%Y-%m-%d %H:%M:%S", localtime(&pi->start_time));
+                       snprintf(processes[child].process_start_time, sizeof(processes[child].process_start_time),
+                                        "%s (remaining: %d:%02d)", proc_start_time,
+                                        remaining_time / 60,
+                                        remaining_time % 60);
+               }
+               else
+               {
+                       strftime(processes[child].process_start_time, sizeof(processes[child].process_start_time),
+                                        "%Y-%m-%d %H:%M:%S", localtime(&pi->start_time));
+               }
+               snprintf(processes[child].client_connection_count, sizeof(processes[child].client_connection_count),
+                                "%d", pi->client_connection_count);
                StrNCpy(processes[child].database, "", POOLCONFIG_MAXIDENTLEN);
                StrNCpy(processes[child].username, "", POOLCONFIG_MAXIDENTLEN);
-               StrNCpy(processes[child].create_time, "", POOLCONFIG_MAXDATELEN);
+               StrNCpy(processes[child].backend_connection_time, "", POOLCONFIG_MAXDATELEN);
                StrNCpy(processes[child].pool_counter, "", POOLCONFIG_MAXCOUNTLEN);
 
                for (pool = 0; pool < pool_config->max_pool; pool++)
@@ -1525,10 +1629,27 @@ get_processes(int *nrows)
                        {
                                StrNCpy(processes[child].database, pi->connection_info[poolBE].database, POOLCONFIG_MAXIDENTLEN);
                                StrNCpy(processes[child].username, pi->connection_info[poolBE].user, POOLCONFIG_MAXIDENTLEN);
-                               strftime(processes[child].create_time, POOLCONFIG_MAXDATELEN, "%Y-%m-%d %H:%M:%S", localtime(&pi->connection_info[poolBE].create_time));
+                               strftime(processes[child].backend_connection_time, POOLCONFIG_MAXDATELEN, "%Y-%m-%d %H:%M:%S", localtime(&pi->connection_info[poolBE].create_time));
                                snprintf(processes[child].pool_counter, POOLCONFIG_MAXCOUNTLEN, "%d", pi->connection_info[poolBE].counter);
                        }
                }
+               switch(pi->status)
+               {
+                       case WAIT_FOR_CONNECT:
+                               StrNCpy(processes[child].status, "Wait for connection", POOLCONFIG_MAXPROCESSSTATUSLEN);
+                               break;
+                       case COMMAND_EXECUTE:
+                               StrNCpy(processes[child].status, "Execute command", POOLCONFIG_MAXPROCESSSTATUSLEN);
+                               break;
+                       case IDLE:
+                               StrNCpy(processes[child].status, "Idle", POOLCONFIG_MAXPROCESSSTATUSLEN);
+                               break;
+                       case IDLE_IN_TRANS:
+                               StrNCpy(processes[child].status, "Idle in transaction", POOLCONFIG_MAXPROCESSSTATUSLEN);
+                               break;
+                       default:
+                               *(processes[child].status) = '\0';
+               }
        }
 
        *nrows = child;
@@ -1542,15 +1663,18 @@ get_processes(int *nrows)
 void
 processes_reporting(POOL_CONNECTION * frontend, POOL_CONNECTION_POOL * backend)
 {
-       static char *field_names[] = {"pool_pid", "start_time", "database", "username", "create_time", "pool_counter"};
+       static char *field_names[] = {"pool_pid", "start_time", "client_connection_count",
+                                                                 "database", "username", "backend_connection_time", "pool_counter", "status"};
 
        static int offsettbl[] = {
                offsetof(POOL_REPORT_PROCESSES, pool_pid),
-               offsetof(POOL_REPORT_PROCESSES, start_time),
+               offsetof(POOL_REPORT_PROCESSES, process_start_time),
+               offsetof(POOL_REPORT_PROCESSES, client_connection_count),
                offsetof(POOL_REPORT_PROCESSES, database),
                offsetof(POOL_REPORT_PROCESSES, username),
-               offsetof(POOL_REPORT_PROCESSES, create_time),
-               offsetof(POOL_REPORT_PROCESSES, pool_counter)
+               offsetof(POOL_REPORT_PROCESSES, backend_connection_time),
+               offsetof(POOL_REPORT_PROCESSES, pool_counter),
+               offsetof(POOL_REPORT_PROCESSES, status),
        };
 
        int     nrows;
index 6d7d9eee5df806732cb2025bdf26553a0369be41..bedcfc6bf10c6e5688fab5dfcd4cc70cce526698 100644 (file)
@@ -399,10 +399,16 @@ pool_ps_idle_display(POOL_CONNECTION_POOL * backend)
 
        sp = MAIN_CONNECTION(backend)->sp;
        if (MAIN(backend)->tstate == 'T')
+       {
                snprintf(psbuf, sizeof(psbuf), "%s %s %s idle in transaction",
                                 sp->user, sp->database, remote_ps_data);
+               set_process_status(IDLE_IN_TRANS);
+       }
        else
+       {
                snprintf(psbuf, sizeof(psbuf), "%s %s %s idle",
                                 sp->user, sp->database, remote_ps_data);
+               set_process_status(IDLE);
+       }
        set_ps_display(psbuf, false);
 }