greenplum 设置连接数及测试

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

测试效果

下载安装jmeter,略
设置jdbc
图片.png
设置查询
图片.png
设置线程数
图片.png
添加各种监听器,略过
查看结果,图是跑两次,没有清空的情况
图片.png
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。