[pgpool-general: 6662] Re: get active number of connection

Takuma Hoshiai hoshiai at sraoss.co.jp
Thu Aug 1 15:58:44 JST 2019


Hi,

On Wed, 31 Jul 2019 22:31:57 +0530
temp temp <ttemp666 at gmail.com> wrote:

> Hi,
> 
> Is there any way to check  the number of active session between client and
> pgpool, meaning at a particular time which client connected to which pgpool
> child process(pid)

you can use pcp_proc_info command.
If 9th value of command output equals '1' , its session is connecting now from client.
pgpool child process is specified by 10th value.

For example:
$ pcp_proc_info -p 11001 -h localhost -w
test test_user 2019-08-01 15:18:53 2019-08-01 15:46:43 3 0 2 13750 0 11968 0
test test_user 2019-08-01 15:18:53 2019-08-01 15:46:43 3 0 2 13751 0 11968 1
test test_user 2019-08-01 15:46:21 2019-08-01 15:46:43 3 0 4 13744 1 13694 0
test test_user 2019-08-01 15:46:21 2019-08-01 15:46:43 3 0 4 13745 1 13694 1
test test_user 2019-08-01 15:08:54 2019-08-01 15:48:37 3 0 1 14024 1 11128 0
test test_user 2019-08-01 15:08:54 2019-08-01 15:48:37 3 0 1 14023 1 11128 1
test test_user 2019-08-01 15:08:54 2019-08-01 15:46:43 3 0 2 13747 0 11129 0
test test_user 2019-08-01 15:08:54 2019-08-01 15:46:43 3 0 2 13746 0 11129 1
test test_user 2019-08-01 15:08:54 2019-08-01 15:48:37 3 0 1 14022 1 11132 0
test test_user 2019-08-01 15:08:54 2019-08-01 15:48:37 3 0 1 14021 1 11132 1
test test_user 2019-08-01 15:08:54 2019-08-01 15:46:43 3 0 5 13748 1 11134 0
test test_user 2019-08-01 15:08:54 2019-08-01 15:46:43 3 0 5 13749 1 11134 1
test test_user 2019-08-01 15:08:54 2019-08-01 15:48:37 3 0 1 14025 1 11135 0
test test_user 2019-08-01 15:08:54 2019-08-01 15:48:37 3 0 1 14026 1 11135 1
test test_user 2019-08-01 15:46:21 2019-08-01 15:46:43 3 0 2 13752 0 13690 0
test test_user 2019-08-01 15:46:21 2019-08-01 15:46:43 3 0 2 13753 0 13690 1

Show a pgpool process pid that it is connected to client:

$ pcp_proc_info -p 11001 -h localhost -w |awk '!colname[$12]++{if($11 == 1) {print  $12}}'
13694
11128
11132
11134
11135


> 
> Thanks

Best Regards,

-- 
Takuma Hoshiai <hoshiai at sraoss.co.jp>



More information about the pgpool-general mailing list