From: Tom Hughes Date: Mon, 15 Feb 2021 18:29:22 +0000 (+0000) Subject: Log autovacuums for promscale X-Git-Url: https://git.openstreetmap.org./chef.git/commitdiff_plain/f7dd6716f0f63c8f74b2a14efe19672a0853c6c2?ds=sidebyside Log autovacuums for promscale --- diff --git a/cookbooks/postgresql/attributes/default.rb b/cookbooks/postgresql/attributes/default.rb index cc8c9a59e..553efa302 100644 --- a/cookbooks/postgresql/attributes/default.rb +++ b/cookbooks/postgresql/attributes/default.rb @@ -36,6 +36,7 @@ default[:postgresql][:settings][:defaults][:default_statistics_target] = "100" default[:postgresql][:settings][:defaults][:jit] = "on" default[:postgresql][:settings][:defaults][:log_min_duration_statement] = "-1" default[:postgresql][:settings][:defaults][:track_activity_query_size] = "1024" +default[:postgresql][:settings][:defaults][:log_autovacuum_min_duration] = "-1" default[:postgresql][:settings][:defaults][:autovacuum_max_workers] = "3" default[:postgresql][:settings][:defaults][:autovacuum_naptime] = "1min" default[:postgresql][:settings][:defaults][:autovacuum_vacuum_scale_factor] = "0.2" diff --git a/cookbooks/postgresql/templates/default/postgresql.conf.erb b/cookbooks/postgresql/templates/default/postgresql.conf.erb index 7ac5bb119..09b026db3 100644 --- a/cookbooks/postgresql/templates/default/postgresql.conf.erb +++ b/cookbooks/postgresql/templates/default/postgresql.conf.erb @@ -144,6 +144,7 @@ stats_temp_directory = '/run/postgresql/<%= @version %>-main.pg_stat_tmp' # AUTOVACUUM PARAMETERS #------------------------------------------------------------------------------ +log_autovacuum_min_duration = <%= @settings[:log_autovacuum_min_duration] || @defaults[:log_autovacuum_min_duration] %> autovacuum_max_workers = <%= @settings[:autovacuum_max_workers] || @defaults[:autovacuum_max_workers] %> autovacuum_naptime = <%= @settings[:autovacuum_naptime] || @defaults[:autovacuum_naptime] %> autovacuum_vacuum_scale_factor = <%= @settings[:autovacuum_vacuum_scale_factor] || @defaults[:autovacuum_vacuum_scale_factor] %> diff --git a/roles/prometheus.rb b/roles/prometheus.rb index 0016c6c0f..e66da0fd9 100644 --- a/roles/prometheus.rb +++ b/roles/prometheus.rb @@ -20,6 +20,7 @@ default_attributes( :random_page_cost => "1.1", :effective_cache_size => "144GB", :default_statistics_target => "500", + :log_autovacuum_min_duration => "0", :autovacuum_max_workers => "10", :autovacuum_naptime => "10", :max_locks_per_transaction => "512"