From 0ef1f505202b9ebaacc3287f0aee36bae15f1644 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Sun, 18 Sep 2016 18:40:58 +0100 Subject: [PATCH] Increase track_activity_query_size to 16Kb on tile servers Closes #92 --- cookbooks/postgresql/attributes/default.rb | 1 + .../postgresql/templates/default/postgresql.conf.erb | 8 ++++++++ roles/tile.rb | 3 ++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/cookbooks/postgresql/attributes/default.rb b/cookbooks/postgresql/attributes/default.rb index 42939d7cd..6a5d68641 100644 --- a/cookbooks/postgresql/attributes/default.rb +++ b/cookbooks/postgresql/attributes/default.rb @@ -26,6 +26,7 @@ default[:postgresql][:settings][:defaults][:random_page_cost] = "4.0" default[:postgresql][:settings][:defaults][:cpu_tuple_cost] = "0.01" default[:postgresql][:settings][:defaults][:effective_cache_size] = "128MB" default[:postgresql][:settings][:defaults][:log_min_duration_statement] = "-1" +default[:postgresql][:settings][:defaults][:track_activity_query_size] = "1024" default[:postgresql][:settings][:defaults][:autovacuum_max_workers] = "3" default[:postgresql][:settings][:defaults][:user_name_maps] = {} default[:postgresql][:settings][:defaults][:early_authentication_rules] = [] diff --git a/cookbooks/postgresql/templates/default/postgresql.conf.erb b/cookbooks/postgresql/templates/default/postgresql.conf.erb index 850fc1b3c..4bfe74fa8 100644 --- a/cookbooks/postgresql/templates/default/postgresql.conf.erb +++ b/cookbooks/postgresql/templates/default/postgresql.conf.erb @@ -110,6 +110,14 @@ log_min_duration_statement = <%= @settings[:log_min_duration_statement] || @defa log_line_prefix = '%t ' +#------------------------------------------------------------------------------ +# RUNTIME STATISTICS +#------------------------------------------------------------------------------ + +# - Query/Index Statistics Collector - + +track_activity_query_size = <%= @settings[:track_activity_query_size] || @defaults[:track_activity_query_size] %> + #------------------------------------------------------------------------------ # AUTOVACUUM PARAMETERS #------------------------------------------------------------------------------ diff --git a/roles/tile.rb b/roles/tile.rb index a0b0e4a23..300c826bd 100644 --- a/roles/tile.rb +++ b/roles/tile.rb @@ -40,7 +40,8 @@ default_attributes( :wal_writer_delay => "500ms", :commit_delay => "10000", :checkpoint_segments => "60", - :max_wal_size => "2880MB" + :max_wal_size => "2880MB", + :track_activity_query_size => "16384" } } }, -- 2.39.5