X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/faf8ae12e85eabb050b0f5eceb2cb67ad1de5261..1bc290ecce828f4a28d096c383815d2aa9199253:/cookbooks/postgresql/templates/default/postgresql.conf.erb diff --git a/cookbooks/postgresql/templates/default/postgresql.conf.erb b/cookbooks/postgresql/templates/default/postgresql.conf.erb index 01b796862..d75c2f427 100644 --- a/cookbooks/postgresql/templates/default/postgresql.conf.erb +++ b/cookbooks/postgresql/templates/default/postgresql.conf.erb @@ -20,11 +20,15 @@ listen_addresses = '<%= @settings[:listen_addresses] || @defaults[:listen_addres <% end -%> port = <%= @settings[:port] || @defaults[:port] %> max_connections = <%= @settings[:max_connections] || @defaults[:max_connections] %> +<% if @version.to_f >= 9.3 %> +unix_socket_directories = '/var/run/postgresql' +<% else -%> unix_socket_directory = '/var/run/postgresql' +<% end -%> # - Security and Authentication - -ssl = true +ssl = <%= @settings[:ssl] || @defaults[:ssl] %> ssl_renegotiation_limit = 0 #------------------------------------------------------------------------------ @@ -39,6 +43,17 @@ work_mem = <%= @settings[:work_mem] || @defaults[:work_mem] %> maintenance_work_mem = <%= @settings[:maintenance_work_mem] || @defaults[:maintenance_work_mem] %> max_stack_depth = <%= @settings[:max_stack_depth] || @defaults[:max_stack_depth] %> +# - Asynchronous Behavior - + +effective_io_concurrency = <%= @settings[:effective_io_concurrency] || @defaults[:effective_io_concurrency] %> +max_worker_processes = <%= @settings[:max_worker_processes] || @defaults[:max_worker_processes] %> +<% if @version.to_f >= 9.6 -%> +max_parallel_workers_per_gather = <%= @settings[:max_parallel_workers_per_gather] || @defaults[:max_parallel_workers_per_gather] %> +<% end -%> +<% if @version.to_f >= 10 -%> +max_parallel_workers = <%= @settings[:max_parallel_workers] || @defaults[:max_parallel_workers] %> +<% end -%> + #------------------------------------------------------------------------------ # WRITE AHEAD LOG #------------------------------------------------------------------------------ @@ -54,8 +69,14 @@ commit_delay = <%= @settings[:commit_delay] || @defaults[:commit_delay] %> # - Checkpoints - +<% 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 - @@ -72,6 +93,9 @@ archive_command = '<%= @settings[:archive_command] || @defaults[:archive_command # - Sending Server(s) - max_wal_senders = <%= @settings[:max_wal_senders] || @defaults[:max_wal_senders] %> +<% if @version.to_f >= 9.4 -%> +max_replication_slots = <%= @settings[:max_replication_slots] || @defaults[:max_replication_slots] %> +<% end -%> # - Standby Servers - @@ -85,10 +109,18 @@ hot_standby_feedback = <%= @settings[:hot_standby_feedback] || @defaults[:hot_st # - Planner Cost Constants - random_page_cost = <%= @settings[:random_page_cost] || @defaults[:random_page_cost] %> +cpu_tuple_cost = <%= @settings[:cpu_tuple_cost] || @defaults[:cpu_tuple_cost] %> effective_cache_size = <%= @settings[:effective_cache_size] || @defaults[:effective_cache_size] %> +# - Other Planner Options - + +default_statistics_target = <%= @settings[:default_statistics_target] || @defaults[:default_statistics_target] %> +<% if @version.to_f >= 12 -%> +jit = <%= @settings[:jit] || @defaults[:jit] %> +<% end -%> + #------------------------------------------------------------------------------ -# ERROR REPORTING AND LOGGING +# REPORTING AND LOGGING #------------------------------------------------------------------------------ # - When to Log - @@ -99,11 +131,26 @@ 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] %> +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] %> +autovacuum_analyze_scale_factor = <%= @settings[:autovacuum_analyze_scale_factor] || @defaults[:autovacuum_analyze_scale_factor] %> +autovacuum_freeze_max_age = <%= @settings[:autovacuum_freeze_max_age] || @defaults[:autovacuum_freeze_max_age] %> +autovacuum_multixact_freeze_max_age = <%= @settings[:autovacuum_multixact_freeze_max_age] || @defaults[:autovacuum_multixact_freeze_max_age] %> #------------------------------------------------------------------------------ # CLIENT CONNECTION DEFAULTS @@ -117,3 +164,21 @@ lc_monetary = 'en_GB.UTF-8' lc_numeric = 'en_GB.UTF-8' lc_time = 'en_GB.UTF-8' default_text_search_config = 'pg_catalog.english' + +# - Shared Library Preloading - + +shared_preload_libraries = '<%= (@settings[:shared_preload_libraries] || @defaults[:shared_preload_libraries]).sort.join(",") %>' + +#------------------------------------------------------------------------------ +# LOCK MANAGEMENT +#------------------------------------------------------------------------------ + +max_locks_per_transaction = <%= @settings[:max_locks_per_transaction] || @defaults[:max_locks_per_transaction] %> + +#------------------------------------------------------------------------------ +# CUSTOMIZED OPTIONS +#------------------------------------------------------------------------------ + +<% Hash(@settings[:customized_options]).sort.each do |name, value| -%> +<%= name %> = <%= value %> +<% end -%>