Greenplum数据库修改默认的最大连接数问题

一、最大连接数的查看

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 RangeDefaultSet Classifications
10 - 8388607250 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 RangeDefaultSet Classifications
integer250 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 ~]$ 

 

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值