1.默认的最大连接数
gpconfig -s maxconnections
gpconfig -s max_connections
Values on all segments are consistent
GUC : max_connections
Master value: 600
Segment value: 3000
设置
gpconfig -c max_connections -v 3000 -m 600
2.pgbouncer最大连接数
psql -p xxxx -d pgbouncer
auth_query | SELECT usename, passwd FROM pg_shadow WHERE usename=$1 | yes
pool_mode | session | yes
max_client_conn | 600 | yes
default_pool_size | 20 | yes
min_pool_size | 0 | yes
修改
vim $GPHOME/share/doc/pgbouncer/pgbouncer.ini
[pgbouncer]
max_client_conn =600
重启
$GPHOME/bin/pgbouncer -Rd $GPHOME/share/doc/pgbouncer/pgbouncer.ini
3.pgbouncer用户最大连接数
修改
vim $GPHOME/share/doc/pgbouncer/pgbouncer.ini
[users]
xxxxx = pool_mode=statement max_user_connections=500
重启
$GPHOME/bin/pgbouncer -Rd $GPHOME/share/doc/pgbouncer/pgbouncer.ini
修改查看资源队列
修改资源队列
ALTER resource queue link_queue with (ACTIVE_STATEMENTS=500,MEMORY_LIMIT='1GB',priority=high);
查看
select * from pg_resqueue_attributes;
link_queue active_statements 500 1
link_queue max_cost -1 2
link_queue min_cost 0 3
link_queue cost_overcommit 0 4
link_queue priority high 5
link_queue memory_limit 1GB 6