Postgres Options Settings

Recommended PostgreSQL configuration for the management node. Changing settings requires restarting the PostgreSQL service. For a failover cluster, rebooting is performed using crm. Add/change the following settings in the /etc/postgresql/14/main/postgresql.conf file. The settings are given as an example for a control node with 16 GB of RAM.

timescaledb.telemetry_level=off max_connections = 2048

shared_buffers = 4GB # Must be set here to ¼ of the total RAM on the node.

effective_cache_size = 4GB maintenance_work_mem = 128MB checkpoint_completion_target = 0.9

default_statistics_target = 100

random_page_cost = 1.1

effective_io_concurrency = 300 # Only for ssd disk, nvme work_mem = 32MB

min_wal_size = 1GB max_wal_size = 4GB checkpoint_timeout = 30min checkpoint_warning = 25min synchronous_commit = off

bgwriter_delay = 10ms bgwriter_lru_maxpages = 900

bgwriter_lru_multiplier = 9.0

vacuum_cost_delay = 0

vacuum_cost_page_hit = 0

vacuum_cost_page_miss = 5

vacuum_cost_page_dirty = 5

vacuum_cost_limit = 2000

vacuum_freeze_min_age = 20000000

vacuum_freeze_table_age = 900000000

vacuum_multixact_freeze_min_age = 20000000

vacuum_multixact_freeze_table_age = 900000000

log_autovacuum_min_duration = 1000000

autovacuum_max_workers = 6 autovacuum_naptime = 1s autovacuum_vacuum_threshold = 500

autovacuum_analyze_threshold = 5000

autovacuum_vacuum_scale_factor = 0

autovacuum_analyze_scale_factor = 0

autovacuum_freeze_max_age = 1000000000

autovacuum_multixact_freeze_max_age = 1000000000

autovacuum_vacuum_cost_delay = 0

autovacuum_vacuum_cost_limit = -1 idle_in_transaction_session_timeout = 600000 # ms max_locks_per_transaction = 400