2013-01-04 42 views
0

我已经安装了带有2个后端的pgpool 3.2.1,使用负载均衡和连接池的流式复制模式。我做了一些高负载测试,以便让pgpool连接更好。pgpool连接被冻结

Suposing该规则是正确的: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中使用的所有连接,并且数据库连接被冻结,并且不允许新连接。

谢谢!

回答

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中配置的连接数的双倍。