Vonng / pigsty

Battery-Included PostgreSQL Distro as a Free & Better RDS Alternative —— Pigsty
https://pigsty.io
GNU Affero General Public License v3.0
3.3k stars 256 forks source link

Changing cluster parameters does not take effect. (问题)更改集群参数后不生效 #439

Closed rayn316 closed 1 month ago

rayn316 commented 1 month ago

Use "pg edit-config pg-meta" to manually change, or use the following command to change. Only "max_parallel_workers_per_gather" takes effect, while "max_connections" and "max_locks_per_transaction" do not take effect even when set to smaller values.

May I ask whether this lack of effectiveness in the modification is a bug, or is it necessary to restart the pg database? If a database restart is required, what would be the command? Currently, the changes only take effect by restarting the server.

使用 pg edit-config pg-meta 手动更改,或者使用下面命令更改,只有max_parallel_workers_per_gather生效,max_connections和max_locks_per_transaction不生效,设置为更小值也不生效

请问一下,这种改动不生效,是bug还是只能重启pg数据库才行,如果要重启数据库,命令是怎么样的,现在只能通过重启服务器生效

# 设置集群参数
pg edit-config -p max_connections=5000 --force pg-meta
pg edit-config -p max_locks_per_transaction=2000 --force pg-meta
pg edit-config -p max_parallel_workers_per_gather=16 --force pg-meta

# 查看
psql -AXtwc 'show max_connections;'
psql -AXtwc 'show max_locks_per_transaction;'
psql -AXtwc 'show max_parallel_workers_per_gather;'

image