From 6710db8d0db6253c5bbcfc90602f53ff388a038c Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Thu, 21 May 2020 21:40:35 +0200 Subject: [PATCH] Make some more of the postgresql configuration key adjustable Basically, if the variables are defined in the host, use them, otherwise use the current values. Signed-off-by: Pierre-Yves Chibon --- roles/postgresql_server/templates/postgresql.conf | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/roles/postgresql_server/templates/postgresql.conf b/roles/postgresql_server/templates/postgresql.conf index 74769d103d..2c51f931b8 100644 --- a/roles/postgresql_server/templates/postgresql.conf +++ b/roles/postgresql_server/templates/postgresql.conf @@ -117,7 +117,11 @@ max_connections = 750 # (change requires restart) shared_buffers = {{ shared_buffers }} # min 128kB or max_connections*16kB # (change requires restart) +{% if temp_buffers %} +temp_buffers = {{ temp_buffers }} # min 800kB +{% else %} temp_buffers = 32MB # min 800kB +{% endif %} #max_prepared_transactions = 5 # can be 0 or more # (change requires restart) # Note: Increasing max_prepared_transactions costs ~600 bytes of shared memory @@ -132,7 +136,12 @@ maintenance_work_mem = 1GB # min 1MB work_mem = 32MB maintenance_work_mem = 2GB # min 1MB {% endif %} + +{% if max_stack_depth %} +max_stack_depth = {{ max_stack_depth }} # min 100kB +{% else %} #max_stack_depth = 2MB # min 100kB +{% endif %} # - Free Space Map - @@ -225,7 +234,9 @@ random_page_cost = 1.1 # same scale as above #cpu_tuple_cost = 0.01 # same scale as above #cpu_index_tuple_cost = 0.005 # same scale as above #cpu_operator_cost = 0.0025 # same scale as above +{% if effective_cache_size %} effective_cache_size = {{ effective_cache_size }} +{% endif %} # - Genetic Query Optimizer -