From 7ee92dd84cf676f7a33c2ba5b0628f963a463f4d Mon Sep 17 00:00:00 2001 From: Dan Notestein <dan@syncad.com> Date: Thu, 30 Jan 2025 22:16:20 +0000 Subject: [PATCH] autovacuum settings that can only be set in postgres.conf, reduce default work_mem to 64MB, plus small tweaks --- docker/postgresql.conf | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/docker/postgresql.conf b/docker/postgresql.conf index ed08e002b..5047fb0ae 100644 --- a/docker/postgresql.conf +++ b/docker/postgresql.conf @@ -119,7 +119,6 @@ max_connections = 100 # (change requires restart) # - Memory - -shared_buffers = 128MB # min 128kB # (change requires restart) #huge_pages = try # on, off, or try # (change requires restart) @@ -222,8 +221,8 @@ dynamic_shared_memory_type = posix # the default is the first option # - Checkpoints - #checkpoint_timeout = 5min # range 30s-1d -max_wal_size = 1GB -min_wal_size = 80MB +max_wal_size = 12GB +min_wal_size = 1GB #checkpoint_completion_target = 0.5 # checkpoint target duration, 0.0 - 1.0 #checkpoint_flush_after = 256kB # measured in pages, 0 disables #checkpoint_warning = 30s # 0 disables @@ -788,11 +787,11 @@ external_pid_file = '/var/run/postgresql/17-main.pid' # write an extra PID fil idle_in_transaction_session_timeout=60000 #ms shared_buffers = 16GB -effective_cache_size = 8GB +effective_cache_size = 16GB maintenance_work_mem = 4GB -work_mem = 1024MB +work_mem = 64MB -checkpoint_completion_target = 0.8 +checkpoint_completion_target = 0.9 checkpoint_timeout = 60min wal_buffers = 512MB @@ -807,6 +806,10 @@ max_wal_senders = 0 # Set to 4 to build indexes faster max_parallel_maintenance_workers = 4 +# these have to be set in postgresql.conf, cannot be set later +autovacuum_max_workers = 5 +autovacuum_vacuum_cost_limit = 5000 + # Allows overriding above configuration settings # include files ending in '.conf' from -- GitLab