pgpool-II 3.7.5 not caching PG connections

198 Views Asked by At

Shouldn't pgpool cache PG backend processes? After disconnecting and reconnecting pool_backendpidchanges.

Relevant parameters:

num_init_children = 1
max_pool = 1
child_life_time = 300
child_max_connections = 0
connection_life_time = 0
client_idle_limit = 0
connection_cache = on

Test:

postgres@node3:/etc/pgpool2$ psql -p 5433 -U postgres postgres
psql (9.6.10)
Type "help" for help.

postgres=# show pool_pools;
LOG:  statement: show pool_pools;
 pool_pid |     start_time      | pool_id | backend_id | database | username |     create_time     | majorversion | minorversion | pool_counter | pool_backendpid | pool_connected 
----------+---------------------+---------+------------+----------+----------+---------------------+--------------+--------------+--------------+-----------------+----------------
 3569     | 2018-09-13 20:18:22 | 0       | 0          | postgres | postgres | 2018-09-13 20:25:04 | 3            | 0            | 1            | 3631            | 1
(1 row)

postgres=# \q
postgres@node3:/etc/pgpool2$ psql -p 5433 -U postgres postgres
psql (9.6.10)
Type "help" for help.

postgres=# show pool_pools;
LOG:  statement: show pool_pools;
 pool_pid |     start_time      | pool_id | backend_id | database | username |     create_time     | majorversion | minorversion | pool_counter | pool_backendpid | pool_connected 
----------+---------------------+---------+------------+----------+----------+---------------------+--------------+--------------+--------------+-----------------+----------------
 3569     | 2018-09-13 20:18:22 | 0       | 0          | postgres | postgres | 2018-09-13 20:25:15 | 3            | 0            | 1            | 3640            | 1
(1 row)
1

There are 1 best solutions below

0
On

Found out why:

connection_cache (boolean)

Caches connections to backends when set to on. Default is on. However, 
connections to template0, template1, postgres and regression databases 
are not cached even if connection_cache is on.

I was connecting to postgres database.