一、最大连接数的查看
gpconfig -s max_connections
二、官方文档说明
要修改最大连接数max_connections的值前,先查看官方文档的介绍:
-
max_connections
官方参数说明:https://gpdb.docs.pivotal.io/6-8/ref_guide/config_params/guc-list.html#max_connections
In a Greenplum Database system, user client connections go through the Greenplum master instance only. Segment instances should allow 5-10 times the amount as the master. When you increase this parameter, max_prepared_transactions must be increased as well.
Value Range | Default | Set Classifications |
---|---|---|
10 - 8388607 | 250 on master 750 on segments | local system restart |
-
max_prepared_transactions
官方参数说明:https://gpdb.docs.pivotal.io/6-8/ref_guide/config_params/guc-list.html#max_prepared_transactions
Sets the maximum number of transactions that can be in the prepared state simultaneously. Greenplum uses prepared transactions internally to ensure data integrity across the segments. This value must be at least as large as the value of max_connections on the master. Segment instances should be set to the same value as the master.
Value Range | Default | Set Classifications |
---|---|---|
integer | 250 on master 250 on segments | local system restart |
四、最大连接数的修改
官方要求修改max_connections的同时,同步修改max_prepared_transactions,为此 :
(1)修改命令为:
gpconfig -c max_connections -v 1500 -m 500
gpconfig -c max_prepared_transactions -v 500
(2)修改完参数后记得重启数据库生效
gpstop -M fast
gpstart
或者:
gpstop -u
(3)最后谨慎的检测下参数是否成功修改:
[gpadmin@mdw ~]$ gpconfig -s max_connections
Values on all segments are consistent
GUC : max_connections
Master value: 500
Segment value: 1500
[gpadmin@mdw ~]$ gpconfig -s max_prepared_transactions
Values on all segments are consistent
GUC : max_prepared_transactions
Master value: 500
Segment value: 500
[gpadmin@mdw ~]$