我已经安装了pgpool 3.2.1,在流复制模式下有2个后端,具有负载平衡和连接池。我做了一些高负载测试,试图封装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 'SELECT COUNT from pg_stat_activity‘的结果是90。
测试2:
num_init_children = 90 max_pool =2
(仅在主目录中) max_connections = 100 superuser_reserved_connections =3
psql -U postgres -c 'SELECT COUNT from pg_stat_activity‘的结果是91。如何处理其他6个连接才能获得多达97个连接?这是我可以连接到postgresql的最大连接数。
在这两种情况下,我都获得了pgpoolAdmin中使用的所有连接,并且到数据库的连接都被冻结,并且不允许任何新的连接。
谢谢!
发布于 2013-03-15 03:44:27
在pgpool中,他们使用以下规则来控制连接:
max_pool*num_init_children <= (max_connections - superuser_reserved_connections) (无需取消查询) max_pool*num_init_children*2 <= (max_connections - superuser_reserved_connections) (需要取消查询)
所以,问题是当你有查询取消时,你必须在postgresql中设置pgpool中配置的双倍连接数。
https://stackoverflow.com/questions/14160961
复制相似问题