pgbouncer 最简单的安装

Posted 27 months ago postgresql pg postgre pgbouncer

pgbouncer只支持编译安装

提前装好openssl-dev libevent-dev

./configure 

make -j8

make install

pg.ini


 [databases]
 cms = host=localhost port=5432 dbname=cms user=cms password=cms

 [pgbouncer]
 listen_port = 6432
 listen_addr = 0.0.0.0
 auth_type = md5
 auth_file = user.txt
 logfile = pgbouncer.log
 pidfile = pgbouncer.pid
 admin_users = cms
 stats_users = status
 max_client_conn = 10000
 default_pool_size = 28

user.txt

"user" "password"

测一下试试

初始化数据

pgbench -i -s 100 -h 127.0.0.1 -p 5432 -U cms cms    

测试一下连接池 大概4w tps

测试环境cpu QL3X + 24G内存 矿盘nvme wsl2+alpine


pgbench -M extended -v -r -P 1 -S -C -c 100 -j 100 -T 120 -h 127.0.0.1 -p 6432 -U cms cms    

测一下本体


pgbench -M extended -v -r -P 1 -S -C -c 100 -j 100 -T 120 -h 127.0.0.1 -p 5432 -U cms cms

点击评论