3

昨天我用 pgbench 测试了 pgpool:

pgbench -c 30 -T 20 -r pgbench -p9999 -h192.168.8.28

并发连接数为 30,pgpool 默认 num_init_children 为 32。

因此,当我设置 -c 33 时,除非我爆发,否则测试将被阻止。


我的问题是:

If my concurrent connections online is 10000, should I set num_init_children=10000? 

num_init_children=10000 意味着 pgpool 以 10000 个进程开始,这很糟糕。

有什么不对 ?

如何为 pgpool 配置 10000 个并发连接?

4

2 回答 2

7

一个 pgpool 子进程可以在任何时候只处理一个客户端连接。因此 num_init_children 的值与预期的最大并发连接数成正比。如果你想通过 pgpool 获得 10,000 个并发连接,除了将 num_init_children 设置为 10,000 之外别无他法。PostgreSQL 还生成一个专用进程来处理每个客户端连接,因此如果 PostgreSQL 服务器在任何情况下都有 10,000 个连接的客户端,它也会有 10,000 个子进程。pgpool 和 PostgreSQL 在这方面的区别在于 pgpool 预先生成 num_init_children 连接数,而 PostgreSQL 按需进行。

于 2016-04-20T12:02:36.537 回答
-1

是的,您必须提到 num_init_children=10000 和 max_pool=1。你也可以这样写 num_init_children=1000 和 max_pool=10

于 2016-04-03T07:30:46.930 回答