[pgpool-general: 9171] How does process_management_mode=dynamic decide which idle connections to drop?

Ron Johnson ronljohnsonjr at gmail.com
Thu Jul 18 01:47:16 JST 2024


Postgresql 14.12

$ pgpool --version
pgpool-II version 4.5.2 (hotooriboshi)

$ psql -p9999 -c "pgpool show all;" | grep -E
'process_management|spare_children' | cut -c1-55
 process_management_strategy                | gentle
 process_management_mode                    | dynamic
 min_spare_children                         | 5
 max_spare_children                         | 10

Attached is a text file showing two queries against pg_stat_activity, about
20 minutes apart.
The oldest idle connections (pids 1244035 through 1244035 in the text file)
haven't been dropped, even though they've been idle for more than an hour,
and other, younger connections were dropped.

I'd have expected an LRU algorithm, but apparently not.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.pgpool.net/pipermail/pgpool-general/attachments/20240717/f56d98e2/attachment.htm>
-------------- next part --------------

$ pgpool --version
pgpool-II version 4.5.2 (hotooriboshi)

$ psql -p9999 -c "pgpool show all;" | grep -E 'process_management|spare_children' | cut -c1-55
 process_management_strategy                | gentle
 process_management_mode                    | dynamic
 min_spare_children                         | 5
 max_spare_children                         | 10

2024-07-17 12:16:39 Query time:

   pid   | db  |  app_name   |  client_name   | usename  |     Query Start ET      |  qry_min   |      Txn Start ET       | txn_min |    state    
---------+-----+-------------+----------------+----------+-------------------------+------------+-------------------------+---------+-------------
 1119423 |     | walreceiver | FISPCDSPGS202b | replicat | 2024-07-16 18:04:01.746 |   1,092.63 |                         |         | active     
 1240913 | cds | JDBC Driver | FISPCDSPGS202c | fis_cds  | 2024-07-17 11:26:13.788 |      50.43 |                         |         | idle       
 1240914 | cds | JDBC Driver | FISPCDSPGS202c | fis_cds  | 2024-07-17 11:26:13.855 |      50.43 |                         |         | idle       
 1240897 | cds | JDBC Driver | FISPCDSPGS202c | fis_cds  | 2024-07-17 11:26:18.952 |      50.34 |                         |         | idle       
 1240904 | cds | JDBC Driver | FISPCDSPGS202c | fis_cds  | 2024-07-17 11:26:18.955 |      50.34 |                         |         | idle       
 1240736 | cds | JDBC Driver | FISPCDSPGS202c | fis_cds  | 2024-07-17 11:26:18.957 |      50.34 |                         |         | idle       
 1240907 | cds | JDBC Driver | FISPCDSPGS202c | fis_cds  | 2024-07-17 11:26:18.958 |      50.34 |                         |         | idle       
 1240911 | cds | JDBC Driver | FISPCDSPGS202c | fis_cds  | 2024-07-17 11:26:33.977 |      50.09 |                         |         | idle       
 1244035 | cds | pgAdmin 4 - | FISPCDSPGS202c | fis_cds  | 2024-07-17 12:04:17.825 |      12.36 |                         |         | idle       
 1243183 | cds | JDBC Driver | FISPCDSPGS202c | fis_cds  | 2024-07-17 12:04:36.907 |      12.04 |                         |         | idle       
 1240951 | cds |             | FISPCDSPGS202c | fis_cds  | 2024-07-17 12:12:01.033 |       4.64 |                         |         | idle       
 1241229 | cds |             | FISPCDSPGS202c | fis_cds  | 2024-07-17 12:12:01.033 |       4.64 |                         |         | idle       
 1241230 | cds |             | FISPCDSPGS202c | fis_cds  | 2024-07-17 12:12:01.034 |       4.64 |                         |         | idle       
 1240940 | cds |             | FISPCDSPGS202c | fis_cds  | 2024-07-17 12:12:01.034 |       4.64 |                         |         | idle       
 1240946 | cds |             | FISPCDSPGS202c | fis_cds  | 2024-07-17 12:12:01.035 |       4.64 |                         |         | idle       
 1241228 | cds |             | FISPCDSPGS202c | fis_cds  | 2024-07-17 12:12:01.035 |       4.64 |                         |         | idle       
 1240905 | cds | JDBC Driver | FISPCDSPGS202c | fis_cds  | 2024-07-17 12:12:03.210 |       4.60 |                         |         | idle       
 1244693 | cds | JDBC Driver | FISPCDSPGS202c | fis_cds  | 2024-07-17 12:12:52.031 |       3.79 |                         |         | idle       
 1244695 | cds | JDBC Driver | FISPCDSPGS202c | fis_cds  | 2024-07-17 12:12:52.123 |       3.79 |                         |         | idle       
 1240938 | cds | JDBC Driver | FISPCDSPGS202c | fis_cds  | 2024-07-17 12:12:52.599 |       3.78 |                         |         | idle       
 1244696 | cds | JDBC Driver | FISPCDSPGS202c | fis_cds  | 2024-07-17 12:12:52.682 |       3.78 |                         |         | idle       
 1241234 | cds | JDBC Driver | FISPCDSPGS202c | fis_cds  | 2024-07-17 12:13:57.950 |       2.69 |                         |         | idle       
 1240908 | cds | JDBC Driver | FISPCDSPGS202c | fis_cds  | 2024-07-17 12:14:05.897 |       2.56 |                         |         | idle       
 1243184 | cds | JDBC Driver | FISPCDSPGS202c | fis_cds  | 2024-07-17 12:14:59.209 |       1.67 |                         |         | idle       
 1240912 | cds | JDBC Driver | FISPCDSPGS202c | fis_cds  | 2024-07-17 12:15:27.396 |       1.20 |                         |         | idle       
 1241233 | cds | JDBC Driver | FISPCDSPGS202c | fis_cds  | 2024-07-17 12:16:03.298 |        .60 |                         |         | idle       
 1240903 | cds | JDBC Driver | FISPCDSPGS202c | fis_cds  | 2024-07-17 12:16:12.473 |        .45 |                         |         | idle       
 1244629 | cds | JDBC Driver | FISPCDSPGS202c | fis_cds  | 2024-07-17 12:16:17.577 |        .37 |                         |         | idle       
 1241232 | cds | JDBC Driver | FISPCDSPGS202c | fis_cds  | 2024-07-17 12:16:22.688 |        .28 |                         |         | idle       
 1240958 | cds | JDBC Driver | FISPCDSPGS202c | fis_cds  | 2024-07-17 12:16:27.792 |        .19 |                         |         | idle       
 1241238 | cds | JDBC Driver | FISPCDSPGS202c | fis_cds  | 2024-07-17 12:16:32.905 |        .11 |                         |         | idle       
 1240945 | cds | JDBC Driver | FISPCDSPGS202c | fis_cds  | 2024-07-17 12:16:34.379 |        .09 |                         |         | idle       
 1243517 | cds | pgAdmin 4 - | FISPCDSPGS202c | fis_cds  | 2024-07-17 12:16:36.873 |        .04 |                         |         | idle       
 1240935 | cds | JDBC Driver | FISPCDSPGS202c | fis_cds  | 2024-07-17 12:16:38.017 |        .02 |                         |         | idle       
 1240926 | cds | JDBC Driver | FISPCDSPGS202c | fis_cds  | 2024-07-17 12:16:38.324 |        .02 |                         |         | idle       
 1240915 | cds | JDBC Driver | FISPCDSPGS202c | fis_cds  | 2024-07-17 12:16:38.676 |        .01 |                         |         | idle       
 1240906 | cds | JDBC Driver | FISPCDSPGS202c | fis_cds  | 2024-07-17 12:16:39.050 |        .01 |                         |         | idle       
 1240949 | cds | JDBC Driver | FISPCDSPGS202c | fis_cds  | 2024-07-17 12:16:39.190 |        .00 |                         |         | idle       
 1240957 | cds | JDBC Driver | FISPCDSPGS202c | fis_cds  | 2024-07-17 12:16:39.381 |        .00 |                         |         | idle       
 1240939 | cds | JDBC Driver | FISPCDSPGS202c | fis_cds  | 2024-07-17 12:16:39.382 |        .00 |                         |         | idle       
 1240959 | cds | JDBC Driver | FISPCDSPGS202c | fis_cds  | 2024-07-17 12:16:39.382 |        .00 |                         |         | idle       
 1244637 | cds | JDBC Driver | FISPCDSPGS202c | fis_cds  | 2024-07-17 12:16:39.486 |        .00 | 2024-07-17 12:16:34.639 |     .08 | idle in tra
 1241231 | cds | JDBC Driver | FISPCDSPGS202c | fis_cds  | 2024-07-17 12:16:39.486 |        .00 | 2024-07-17 12:16:30.509 |     .15 | idle in tra
 1240730 | cds | JDBC Driver | FISPCDSPGS202c | fis_cds  | 2024-07-17 12:16:39.487 |        .00 | 2024-07-17 12:16:28.094 |     .19 | idle in tra
 1240910 | cds | JDBC Driver | FISPCDSPGS202c | fis_cds  | 2024-07-17 12:16:39.487 |        .00 | 2024-07-17 12:16:23.830 |     .26 | active     
 1240952 | cds | JDBC Driver | FISPCDSPGS202c | fis_cds  | 2024-07-17 12:16:39.487 |        .00 | 2024-07-17 12:16:27.533 |     .20 | idle in tra
 1119390 |     |             |                |          |                         |            |                         |         | 
 1119393 |     |             |                |          |                         |            |                         |         | 
 1119389 |     |             |                |          |                         |            |                         |         | 
 1119391 |     |             |                |          |                         |            |                         |         | 
 1119392 |     |             |                |          |                         |            |                         |         | 
 1119395 |     |             |                | postgres |                         |            |                         |         | 
(52 rows)

2024-07-17 12:34:30 Query time:

   pid   | db  |  app_name   |  client_name   | usename  |     Query Start ET      |  qry_min   |      Txn Start ET       | txn_min |    state    
---------+-----+-------------+----------------+----------+-------------------------+------------+-------------------------+---------+-------------
 1119423 |     | walreceiver | FISPCDSPGS202b | replicat | 2024-07-16 18:04:01.746 |   1,110.47 |                         |         | active     
 1240913 | cds | JDBC Driver | FISPCDSPGS202c | fis_cds  | 2024-07-17 11:26:13.788 |      68.27 |                         |         | idle       
 1240914 | cds | JDBC Driver | FISPCDSPGS202c | fis_cds  | 2024-07-17 11:26:13.855 |      68.27 |                         |         | idle       
 1240897 | cds | JDBC Driver | FISPCDSPGS202c | fis_cds  | 2024-07-17 11:26:18.952 |      68.19 |                         |         | idle       
 1240904 | cds | JDBC Driver | FISPCDSPGS202c | fis_cds  | 2024-07-17 11:26:18.955 |      68.19 |                         |         | idle       
 1240736 | cds | JDBC Driver | FISPCDSPGS202c | fis_cds  | 2024-07-17 11:26:18.957 |      68.19 |                         |         | idle       
 1240907 | cds | JDBC Driver | FISPCDSPGS202c | fis_cds  | 2024-07-17 11:26:18.958 |      68.19 |                         |         | idle       
 1240911 | cds | JDBC Driver | FISPCDSPGS202c | fis_cds  | 2024-07-17 11:26:33.977 |      67.94 |                         |         | idle       
 1244035 | cds | pgAdmin 4 - | FISPCDSPGS202c | fis_cds  | 2024-07-17 12:04:17.825 |      30.21 |                         |         | idle       
 1244693 | cds | JDBC Driver | FISPCDSPGS202c | fis_cds  | 2024-07-17 12:12:52.031 |      21.64 |                         |         | idle       
 1244695 | cds | JDBC Driver | FISPCDSPGS202c | fis_cds  | 2024-07-17 12:12:52.123 |      21.63 |                         |         | idle       
 1244696 | cds | JDBC Driver | FISPCDSPGS202c | fis_cds  | 2024-07-17 12:12:52.682 |      21.63 |                         |         | idle       
 1240939 | cds | JDBC Driver | FISPCDSPGS202c | fis_cds  | 2024-07-17 12:30:00.103 |       4.50 |                         |         | idle       
 1244629 | cds | JDBC Driver | FISPCDSPGS202c | fis_cds  | 2024-07-17 12:30:49.427 |       3.68 |                         |         | idle       
 1241231 | cds | JDBC Driver | FISPCDSPGS202c | fis_cds  | 2024-07-17 12:30:49.428 |       3.68 |                         |         | idle       
 1240958 | cds | JDBC Driver | FISPCDSPGS202c | fis_cds  | 2024-07-17 12:30:49.428 |       3.68 |                         |         | idle       
 1241234 | cds | JDBC Driver | FISPCDSPGS202c | fis_cds  | 2024-07-17 12:30:49.429 |       3.68 |                         |         | idle       
 1240905 | cds | JDBC Driver | FISPCDSPGS202c | fis_cds  | 2024-07-17 12:32:55.752 |       1.57 |                         |         | idle       
 1240908 | cds | JDBC Driver | FISPCDSPGS202c | fis_cds  | 2024-07-17 12:32:55.758 |       1.57 |                         |         | idle       
 1240903 | cds | JDBC Driver | FISPCDSPGS202c | fis_cds  | 2024-07-17 12:34:12.468 |        .30 |                         |         | idle       
 1240945 | cds | JDBC Driver | FISPCDSPGS202c | fis_cds  | 2024-07-17 12:34:13.555 |        .28 |                         |         | idle       
 1240938 | cds | JDBC Driver | FISPCDSPGS202c | fis_cds  | 2024-07-17 12:34:17.579 |        .21 |                         |         | idle       
 1243517 | cds | pgAdmin 4 - | FISPCDSPGS202c | fis_cds  | 2024-07-17 12:34:18.168 |        .20 |                         |         | idle       
 1241238 | cds | JDBC Driver | FISPCDSPGS202c | fis_cds  | 2024-07-17 12:34:22.696 |        .12 |                         |         | idle       
 1241233 | cds | JDBC Driver | FISPCDSPGS202c | fis_cds  | 2024-07-17 12:34:23.119 |        .12 |                         |         | idle       
 1243184 | cds | JDBC Driver | FISPCDSPGS202c | fis_cds  | 2024-07-17 12:34:25.336 |        .08 |                         |         | idle       
 1240906 | cds | JDBC Driver | FISPCDSPGS202c | fis_cds  | 2024-07-17 12:34:25.887 |        .07 |                         |         | idle       
 1240935 | cds | JDBC Driver | FISPCDSPGS202c | fis_cds  | 2024-07-17 12:34:27.804 |        .04 |                         |         | idle       
 1240952 | cds | JDBC Driver | FISPCDSPGS202c | fis_cds  | 2024-07-17 12:34:28.571 |        .03 |                         |         | idle       
 1240959 | cds | JDBC Driver | FISPCDSPGS202c | fis_cds  | 2024-07-17 12:34:28.572 |        .03 |                         |         | idle       
 1240730 | cds | JDBC Driver | FISPCDSPGS202c | fis_cds  | 2024-07-17 12:34:29.142 |        .02 |                         |         | idle       
 1240912 | cds | JDBC Driver | FISPCDSPGS202c | fis_cds  | 2024-07-17 12:34:29.201 |        .02 |                         |         | idle       
 1241232 | cds | JDBC Driver | FISPCDSPGS202c | fis_cds  | 2024-07-17 12:34:29.663 |        .01 |                         |         | idle       
 1240949 | cds | JDBC Driver | FISPCDSPGS202c | fis_cds  | 2024-07-17 12:34:29.749 |        .01 |                         |         | idle       
 1244637 | cds | JDBC Driver | FISPCDSPGS202c | fis_cds  | 2024-07-17 12:34:30.052 |        .00 |                         |         | idle       
 1240957 | cds | JDBC Driver | FISPCDSPGS202c | fis_cds  | 2024-07-17 12:34:30.188 |        .00 |                         |         | idle       
 1240915 | cds | JDBC Driver | FISPCDSPGS202c | fis_cds  | 2024-07-17 12:34:30.189 |        .00 | 2024-07-17 12:34:30.183 |     .00 | idle in tra
 1243183 | cds | JDBC Driver | FISPCDSPGS202c | fis_cds  | 2024-07-17 12:34:30.189 |        .00 | 2024-07-17 12:34:18.670 |     .19 | idle in tra
 1240926 | cds | JDBC Driver | FISPCDSPGS202c | fis_cds  | 2024-07-17 12:34:30.190 |        .00 | 2024-07-17 12:34:22.019 |     .14 | active     
 1240910 | cds | JDBC Driver | FISPCDSPGS202c | fis_cds  | 2024-07-17 12:34:30.190 |        .00 | 2024-07-17 12:34:17.352 |     .21 | active     
 1119395 |     |             |                | postgres |                         |            |                         |         | 
 1119392 |     |             |                |          |                         |            |                         |         | 
 1119393 |     |             |                |          |                         |            |                         |         | 
 1119389 |     |             |                |          |                         |            |                         |         | 
 1119391 |     |             |                |          |                         |            |                         |         | 
 1119390 |     |             |                |          |                         |            |                         |         | 
(46 rows)


More information about the pgpool-general mailing list