Log autovacuums for promscale
authorTom Hughes <tom@compton.nu>
Mon, 15 Feb 2021 18:29:22 +0000 (18:29 +0000)
committerTom Hughes <tom@compton.nu>
Mon, 15 Feb 2021 18:46:12 +0000 (18:46 +0000)
cookbooks/postgresql/attributes/default.rb
cookbooks/postgresql/templates/default/postgresql.conf.erb
roles/prometheus.rb

index cc8c9a59ef00d73f995444f46d70164ce4d5a149..553efa302669fb072e010087eb51e088a84099cf 100644 (file)
@@ -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"
index 7ac5bb119eea6d722f9cad30f03114534c61eaee..09b026db3c7fed4c6e1beb82584105d9f7c09bb1 100644 (file)
@@ -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] %>
index 0016c6c0fef33d6018252652d750daa56f471d36..e66da0fd9f415dea2200ffae9721603fd02be130 100644 (file)
@@ -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"