pgpool-II 3.7.5不缓存PG连接

时间:2018-09-13 19:33:11

标签: pgpool

pgpool不能缓存PG后端进程吗?断开连接并重新连接后,pool_backendpid进行更改。

相关参数:

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

测试:

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 个答案:

答案 0 :(得分:0)

找出原因:

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.

我正在连接到postgres数据库。