【发布时间】:2020-03-14 00:29:23
【问题描述】:
我创建了 PostgreSql v12(port 5432) 和 pgbouncer v1.9(port 6432)。然后我在 pgbouncer 服务器上创建了一个新的测试数据库。我按照以下步骤操作:
-
pgbench -h localhost -p 6432 -U postgres -i -s 150 test它已经创建了 pgbench 表。
-
pgbench -p 6432 -U postgres -c 200 -j 2 -P 60 -t 1000 -d test如果我使用
-c 85,它将毫无错误地运行。当我将-c增加到超过 85 或 90 时,我得到了too many client connections for select()。 -
我已经配置了
pgbouncer.ini和postgresql.conf文件。 在 pgbouncer 我添加了test = host=localhost port=5432 dbname=test & pool_mode = transaction,max_client_conn = 10000, default_pool_size = 20在
postgresql.conf中,我将max_connections从 100 增加到 1000,将shared_buffers从 128 增加到 256MB。
我想清理包含 100 多个客户端的数据库。
【问题讨论】:
-
您能解释一下“用客户端清空数据库”是什么意思吗?
-
你的操作系统是什么?你是如何安装 PostgreSQL 和 pgbouncer 的?请不要发布文字图片。
标签: postgresql pgbouncer