我正在通过使用一个非常大的数据库使用pbBouncer来测试pgBench。
我最初是用一个大型数据库(731 its )来设置pgBench的--结果它只是一个巨大的帐户表(626 Its)。
./pgbench -h 172.10.7.35 -U pgbench -p 5432 -i -s 50000我已经将我的pgBouncer配置为:
[databases]
pgbench = dbname=pgbench host=172.10.7.35 port=5432
;; Configuration section
[pgbouncer]
logfile = /var/log/pgbouncer/pgbouncer.log
pidfile = /var/run/pgbouncer/pgbouncer.pid
;; IP address or * which means all IPs
listen_addr = *
listen_port = 6432
;; any, trust, plain, md5, cert, hba, pam
auth_type = md5
auth_file = /etc/pgbouncer/userlist.txt
;; comma-separated list of users who are allowed to change settings
admin_users = postgres
;; comma-separated list of users who are just allowed to use SHOW command
stats_users = stats, postgres
;; When server connection is released back to pool:
;; session - after client disconnects (default)
;; transaction - after transaction finishes
;; statement - after statement finishes
;pool_mode = session
;; Total number of clients that can connect
max_client_conn = 1000
;; Default pool size. 20 is good number when transaction pooling
;; is in use, in session pooling it needs to be the number of
;; max clients you want to handle at any moment
default_pool_size = 25
; how many additional connection to allow in case of trouble
reserve_pool_size = 5我在postgres中的max_connections配置为1000,如果我通过pgBouncer可以减少这个值吗?
通过pgBouncer运行以下代码时
./pgbench -c 1000 -j 4 -t 1000 pgbench -h 172.10.7.35 -p 6432 -U pgbench我收到了很多query_wait_timeout错误。
client XXX aborted in state 4: ERROR: query_wait_timeout我知道缺省值是120秒,但这肯定就足够了?
为什么pgBouncer不能处理连接的数量?
我有5处理器和40 at内存,shared_buffers为12 at。
对于我为什么要得到这个,有什么建议吗?这是扩展query_wait_timeout的问题吗?
任何帮助都是非常感谢的。
发布于 2021-07-23 17:07:29
您只允许一次拥有25+5 =30个连接到真实的数据库。你正试图同时拥有1000个连接。其他人得等一段时间。他们不愿意等太久。
现在还不清楚你希望在这里发生什么。您是否认为会话将共享,即使您处于会话池模式,而不是更好的池模式之一?您认为一个会话会比实际更快地完成其1000个事务并将其连接移交给其他人吗?
https://dba.stackexchange.com/questions/296081
复制相似问题