Add max_wal_size support for postgresql 9.5
authorTom Hughes <tom@compton.nu>
Mon, 15 Aug 2016 18:28:50 +0000 (19:28 +0100)
committerTom Hughes <tom@compton.nu>
Mon, 15 Aug 2016 18:28:50 +0000 (19:28 +0100)
cookbooks/postgresql/attributes/default.rb
cookbooks/postgresql/templates/default/postgresql.conf.erb
roles/db.rb
roles/nominatim.rb
roles/owl.rb
roles/tile.rb

index bb6b0fd..42939d7 100644 (file)
@@ -15,6 +15,8 @@ default[:postgresql][:settings][:defaults][:wal_writer_delay] = "200ms"
 default[:postgresql][:settings][:defaults][:commit_delay] = "0"
 default[:postgresql][:settings][:defaults][:checkpoint_segments] = "3"
 default[:postgresql][:settings][:defaults][:checkpoint_timeout] = "5min"
+default[:postgresql][:settings][:defaults][:max_wal_size] = "1GB"
+default[:postgresql][:settings][:defaults][:min_wal_size] = "80MB"
 default[:postgresql][:settings][:defaults][:checkpoint_completion_target] = "0.5"
 default[:postgresql][:settings][:defaults][:archive_mode] = "off"
 default[:postgresql][:settings][:defaults][:max_wal_senders] = "0"
index 754131e..850fc1b 100644 (file)
@@ -58,10 +58,14 @@ commit_delay = <%= @settings[:commit_delay] || @defaults[:commit_delay] %>
 
 # - Checkpoints -
 
-<% if @version.to_f < 9.5 %>
+<% if @version.to_f < 9.5 -%>
 checkpoint_segments = <%= @settings[:checkpoint_segments] || @defaults[:checkpoint_segments] %>
 <% end -%>
 checkpoint_timeout = <%= @settings[:checkpoint_timeout] || @defaults[:checkpoint_timeout] %>
+<% if @version.to_f >= 9.5 -%>
+max_wal_size = <%= @settings[:max_wal_size] || @defaults[:max_wal_size] %>
+min_wal_size = <%= @settings[:min_wal_size] || @defaults[:min_wal_size] %>
+<% end -%>
 checkpoint_completion_target = <%= @settings[:checkpoint_completion_target] || @defaults[:checkpoint_completion_target] %>
 
 # - Archiving -
index df79f70..aa8679d 100644 (file)
@@ -46,6 +46,7 @@ default_attributes(
         :max_connections => "600",
         :max_stack_depth => "7MB",
         :checkpoint_segments => "32",
+        :max_wal_size => "1536MB",
         :checkpoint_completion_target => "0.8",
         :cpu_tuple_cost => "0.1",
         :late_authentication_rules => [
index 041cd0e..81fc388 100644 (file)
@@ -29,6 +29,7 @@ default_attributes(
         :synchronous_commit => "off",
         :checkpoint_segments => "32",
         :checkpoint_timeout => "10min",
+        :max_wal_size => "1536MB",
         :checkpoint_completion_target => "0.9",
         :shared_buffers => "2GB",
         :autovacuum_max_workers => "1"
index 44f44c6..08d7b2f 100644 (file)
@@ -29,6 +29,7 @@ default_attributes(
       :defaults => {
         :fsync => "off",
         :checkpoint_segments => "30",
+        :max_wal_size => "1440MB",
         :checkpoint_completion_target => "0.9",
         :random_page_cost => "2.0",
         :log_min_duration_statement => "3000"
index 9849fed..433805f 100644 (file)
@@ -30,7 +30,8 @@ default_attributes(
         :wal_buffers => "1024kB",
         :wal_writer_delay => "500ms",
         :commit_delay => "10000",
-        :checkpoint_segments => "60"
+        :checkpoint_segments => "60",
+        :max_wal_size => "2880MB"
       }
     }
   },