過去,當我進行了一些配置更改(例如增加max_connections)時,我已經能夠使這些更改生效,而無需使用SELECT pg_reload_conf()...根據檔案重新啟動資料庫服務器。
但是現在,它不起作用......我最近升級到 postgresql 14 所以也許就是這樣?有任何想法嗎?配置更改使其進入postgresql.auto.conf檔案,并且在重新啟動服務器后生效,但我想知道為什么pg_reload_conf()不起作用。
下面的示例流程:
# SHOW max_connections;
max_connections
-----------------
300
(1 row)
# ALTER SYSTEM SET max_connections = '301';
ALTER SYSTEM
# SHOW max_connections;
max_connections
-----------------
300
(1 row)
# SELECT pg_reload_conf();
pg_reload_conf
----------------
t
(1 row)
# SHOW max_connections;
max_connections
-----------------
300
(1 row)
# more /var/lib/postgresql/data/postgresql.auto.conf
# Do not edit this file manually!
# It will be overwritten by the ALTER SYSTEM command.
shared_buffers = '2GB'
wal_buffers = '64MB'
work_mem = '8MB'
maintenance_work_mem = '128MB'
max_connections = '301'
uj5u.com熱心網友回復:
從手冊中參考
確定與資料庫服務器的最大并發連接數。默認值通常為 100 個連接,但如果您的內核設定不支持它(在 initdb 期間確定),則可能會更少。該引數只能在服務器啟動時設定。
(強調我的)
所以這是意料之中的,max_connections不能在不重啟服務器的情況下改變。
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/341485.html
標籤:PostgreSQL
