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 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 ~]$ 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章