pgpool连接被冻结

时间:2013-01-04 16:29:04

标签: postgresql-9.1 connection pgpool

我已经在流式复制模式下安装了带有2个后端的pgpool 3.2.1,带有负载平衡和连接池。我做了一些高负载测试,试图解决pgpool连接问题。

假设此规则正确:max_pool * num_init_children< =(max_connections - superuser_reserved_connections)

测试1:

num_init_children = 90 max_pool = 1

(仅限主人) max_connections = 100 superuser_reserved_connections = 3

psql -U postgres -c的结果'来自pg_stat_activity的SELECT COUNT'为90.

测试2:

num_init_children = 90 max_pool = 2

(仅限主人) max_connections = 100 superuser_reserved_connections = 3

psql -U postgres -c的结果'来自pg_stat_activity的SELECT COUNT'是91.其他6个连接最多可以获得97个连接?这是我可以获得postgresql的最大连接数。

在这两种情况下,我都会获得pgpoolAdmin中使用的所有连接,并且与数据库的连接被冻结,并且不允许新的连接。

谢谢!

1 个答案:

答案 0 :(得分:0)

在pgpool中,他们使用以下规则来控制连接:

max_pool * num_init_children< =(max_connections - superuser_reserved_connections)(无需查询取消) max_pool * num_init_children * 2< =(max_connections - superuser_reserved_connections)(需要查询取消)

所以,问题是当您有查询取消时,必须在postgresql中设置pgpool中配置的双重连接数。

相关问题