[pgpool-hackers: 4017] Re: Proposal: add connection count to pcp_proc_info and show pool_process

KAWAMOTO Masaya kawamoto at sraoss.co.jp
Tue Sep 7 14:41:36 JST 2021


> >> Actually I expected that "remaining" shows the remaining time before
> >> client_idle_limit expires. Suppose client_idle_limit = 300.  If clent
> >> is idle for 100 seconds, "remaining" should be 300 - 100 = 200 seconds
> >> = 3:20.
> >> 
> >> You can caliculate the value by:
> >> pool_config->client_idle_limit - backend->info->client_idle_duration.
> > 
> > I misunderstood "remaining" means.
> > I changed the way of caloculating "remaining" and  that If a connection is in IDLE state, the
> > "remaining" of the other connection in the same process show the same time.
> > Is this your expected one?
> 
> Yes. (I assume that in the example below client_idle_limit is 300 seconds).
> 
> BTW, if client_idle_limit = 0, what will show? Something like "(remaining: 0:00)"?

In that case, (remaining: xx:xx) is not desplayed. start_time is displayed as the current version.

-bash-4.2$ /usr/pgsql-13/bin/psql -p 11000 -c "show pool_processes"
 pool_pid |     start_time      | client_connection_count | database | username | backend_connection_time | pool_counter |       status
----------+---------------------+-------------------------+----------+----------+-------------------------+--------------+---------------------
 27066    | 2021-09-07 05:40:11 | 0                       |          |          |                         |              | Wait for connection
 27067    | 2021-09-07 05:40:11 | 0                       |          |          |                         |              | Wait for connection
 27068    | 2021-09-07 05:40:11 | 0                       |          |          |                         |              | Wait for connection
 27069    | 2021-09-07 05:40:11 | 0                       | postgres | postgres | 2021-09-07 05:40:15     | 1            | Idle
 27070    | 2021-09-07 05:40:11 | 0                       |          |          |                         |              | Wait for connection
 27071    | 2021-09-07 05:40:11 | 0                       |          |          |                         |              | Wait for connection
 27072    | 2021-09-07 05:40:11 | 0                       |          |          |                         |              | Wait for connection
 27073    | 2021-09-07 05:40:11 | 0                       | postgres | postgres | 2021-09-07 05:40:25     | 1            | Execute command

-- 
KAWAMOTO Masaya <kawamoto ¡÷ sraoss.co.jp>
SRA OSS, Inc. Japan


More information about the pgpool-hackers mailing list