From 7513ed129eeb988f14e80ec81cb2fe17257b8337 Mon Sep 17 00:00:00 2001 From: Someone Date: Sun, 24 Aug 2025 00:23:41 +0200 Subject: [PATCH] roles/server/postgresql/files --- .../postgresql/files/default/postgresql.conf | 135 +++++++++++------- 1 file changed, 82 insertions(+), 53 deletions(-) diff --git a/roles/server/postgresql/files/default/postgresql.conf b/roles/server/postgresql/files/default/postgresql.conf index b0986d7..48669c1 100644 --- a/roles/server/postgresql/files/default/postgresql.conf +++ b/roles/server/postgresql/files/default/postgresql.conf @@ -69,9 +69,10 @@ listen_addresses = '*' # what IP address(es) to listen on; # defaults to 'localhost'; use '*' for all # (change requires restart) port = 5432 # (change requires restart) -max_connections = 500 # (change requires restart) +max_connections = 1000 # (change requires restart) +#reserved_connections = 0 # (change requires restart) #superuser_reserved_connections = 3 # (change requires restart) -unix_socket_directories = '/var/run/postgresql' # comma-separated list of directories +unix_socket_directories = '/var/run/postgresql' # comma-separated list of directories # (change requires restart) #unix_socket_group = '' # (change requires restart) unix_socket_permissions = 0770 # begin with 0 to use octal notation @@ -101,11 +102,12 @@ unix_socket_permissions = 0770 # begin with 0 to use octal notation #authentication_timeout = 1min # 1s-600s password_encryption = md5 # scram-sha-256 or md5 -#db_user_namespace = off +#scram_iterations = 4096 # GSSAPI using Kerberos #krb_server_keyfile = 'FILE:${sysconfdir}/krb5.keytab' #krb_caseins_users = off +#gss_accept_delegation = off # - SSL - @@ -115,7 +117,7 @@ ssl_cert_file = '/etc/ssl/certs/ssl-cert-snakeoil.pem' #ssl_crl_file = '' #ssl_crl_dir = '' ssl_key_file = '/etc/ssl/private/ssl-cert-snakeoil.key' -#ssl_ciphers = 'HIGH:MEDIUM:+3DES:!aNULL' # allowed SSL ciphers +#ssl_ciphers = 'HIGH:MEDIUM:+3DES:!aNULL' # allowed SSL ciphers #ssl_prefer_server_ciphers = on #ssl_ecdh_curve = 'prime256v1' #ssl_min_protocol_version = 'TLSv1.2' @@ -144,8 +146,8 @@ temp_buffers = 4GB # min 800kB # you actively intend to use prepared transactions. work_mem = 4GB # min 64kB #hash_mem_multiplier = 2.0 # 1-1000.0 multiplier on hash table work_mem -maintenance_work_mem = 4GB # min 1MB -#autovacuum_work_mem = -1 # min 1MB, or -1 to use maintenance_work_mem +#maintenance_work_mem = 64MB # min 64kB +#autovacuum_work_mem = -1 # min 64kB, or -1 to use maintenance_work_mem #logical_decoding_work_mem = 64MB # min 64kB #max_stack_depth = 2MB # min 100kB #shared_memory_type = mmap # the default is the first option @@ -162,12 +164,27 @@ dynamic_shared_memory_type = posix # the default is usually the first option # mmap # (change requires restart) #min_dynamic_shared_memory = 0MB # (change requires restart) +#vacuum_buffer_usage_limit = 2MB # size of vacuum and analyze buffer access strategy ring; + # 0 to disable vacuum buffer access strategy; + # range 128kB to 16GB + +# SLRU buffers (change requires restart) +#commit_timestamp_buffers = 0 # memory for pg_commit_ts (0 = auto) +#multixact_offset_buffers = 16 # memory for pg_multixact/offsets +#multixact_member_buffers = 32 # memory for pg_multixact/members +#notify_buffers = 16 # memory for pg_notify +#serializable_buffers = 32 # memory for pg_serial +#subtransaction_buffers = 0 # memory for pg_subtrans (0 = auto) +#transaction_buffers = 0 # memory for pg_xact (0 = auto) # - Disk - #temp_file_limit = -1 # limits per-process temp file space # in kilobytes, or -1 for no limit +#max_notify_queue_pages = 1048576 # limits the number of SLRU pages allocated + # for NOTIFY / LISTEN queue + # - Kernel Resources - #max_files_per_process = 1000 # min 64 @@ -193,14 +210,13 @@ dynamic_shared_memory_type = posix # the default is usually the first option #backend_flush_after = 0 # measured in pages, 0 disables #effective_io_concurrency = 1 # 1-1000; 0 disables prefetching #maintenance_io_concurrency = 10 # 1-1000; 0 disables prefetching +#io_combine_limit = 128kB # usually 1-32 blocks (depends on OS) #max_worker_processes = 8 # (change requires restart) -#max_parallel_workers_per_gather = 2 # taken from max_parallel_workers -#max_parallel_maintenance_workers = 2 # taken from max_parallel_workers -#max_parallel_workers = 8 # maximum number of max_worker_processes that +#max_parallel_workers_per_gather = 2 # limited by max_parallel_workers +#max_parallel_maintenance_workers = 2 # limited by max_parallel_workers +#max_parallel_workers = 8 # number of max_worker_processes that # can be used in parallel operations #parallel_leader_participation = on -#old_snapshot_threshold = -1 # 1min-60d; -1 disables; 0 is immediate - # (change requires restart) #------------------------------------------------------------------------------ @@ -250,29 +266,29 @@ min_wal_size = 80MB # - Prefetching during recovery - -#recovery_prefetch = try # prefetch pages referenced in the WAL? -#wal_decode_buffer_size = 512kB # lookahead window used for prefetching - # (change requires restart) +#recovery_prefetch = try # prefetch pages referenced in the WAL? +#wal_decode_buffer_size = 512kB # lookahead window used for prefetching + # (change requires restart) # - Archiving - #archive_mode = off # enables archiving; off, on, or always # (change requires restart) -#archive_library = '' # library to use to archive a logfile segment +#archive_library = '' # library to use to archive a WAL file # (empty string indicates archive_command should # be used) -#archive_command = '' # command to use to archive a logfile segment +#archive_command = '' # command to use to archive a WAL file # placeholders: %p = path of file to archive # %f = file name only # e.g. 'test ! -f /mnt/server/archivedir/%f && cp %p /mnt/server/archivedir/%f' -#archive_timeout = 0 # force a logfile segment switch after this +#archive_timeout = 0 # force a WAL file switch after this # number of seconds; 0 disables # - Archive Recovery - # These are only used in recovery mode. -#restore_command = '' # command to use to restore an archived logfile segment +#restore_command = '' # command to use to restore an archived WAL file # placeholders: %p = path of file to restore # %f = file name only # e.g. 'cp /mnt/server/archivedir/%f %p' @@ -284,7 +300,7 @@ min_wal_size = 80MB # Set these only when performing a targeted recovery. #recovery_target = '' # 'immediate' to end recovery as soon as a - # consistent state is reached + # consistent state is reached # (change requires restart) #recovery_target_name = '' # the named restore point to which recovery will proceed # (change requires restart) @@ -294,14 +310,19 @@ min_wal_size = 80MB # (change requires restart) #recovery_target_lsn = '' # the WAL LSN up to which recovery will proceed # (change requires restart) -#recovery_target_inclusive = on # Specifies whether to stop: +#recovery_target_inclusive = on # Specifies whether to stop: # just after the specified recovery target (on) # just before the recovery target (off) # (change requires restart) #recovery_target_timeline = 'latest' # 'current', 'latest', or timeline ID - # (change requires restart) + # (change requires restart) #recovery_target_action = 'pause' # 'pause', 'promote', 'shutdown' - # (change requires restart) + # (change requires restart) + +# - WAL Summarization - + +#summarize_wal = off # run WAL summarizer process? +#wal_summary_keep_time = '10d' # when to remove old summary files, 0 = never #------------------------------------------------------------------------------ @@ -330,7 +351,8 @@ min_wal_size = 80MB # method to choose sync standbys, number of sync standbys, # and comma-separated list of application_name # from standby(s); '*' = all -#vacuum_defer_cleanup_age = 0 # number of xacts by which cleanup is delayed +#synchronized_standby_slots = '' # streaming replication standby server slot + # names that logical walsender processes will wait for # - Standby Servers - @@ -338,7 +360,6 @@ min_wal_size = 80MB #primary_conninfo = '' # connection string to sending server #primary_slot_name = '' # replication slot on sending server -#promote_trigger_file = '' # file name whose presence ends recovery #hot_standby = on # "off" disallows queries during recovery # (change requires restart) #max_standby_archive_delay = 30s # max delay before canceling queries @@ -359,6 +380,7 @@ min_wal_size = 80MB #wal_retrieve_retry_interval = 5s # time to wait before retrying to # retrieve WAL after a failed attempt #recovery_min_apply_delay = 0 # minimum delay for applying changes during recovery +#sync_replication_slots = off # enables slot synchronization on the physical standby from the primary # - Subscribers - @@ -367,6 +389,7 @@ min_wal_size = 80MB #max_logical_replication_workers = 4 # taken from max_worker_processes # (change requires restart) #max_sync_workers_per_subscription = 2 # taken from max_logical_replication_workers +#max_parallel_apply_workers_per_subscription = 2 # taken from max_logical_replication_workers #------------------------------------------------------------------------------ @@ -392,9 +415,11 @@ min_wal_size = 80MB #enable_partition_pruning = on #enable_partitionwise_join = off #enable_partitionwise_aggregate = off +#enable_presorted_aggregate = on #enable_seqscan = on #enable_sort = on #enable_tidscan = on +#enable_group_by_reordering = on # - Planner Cost Constants - @@ -403,7 +428,7 @@ min_wal_size = 80MB #cpu_tuple_cost = 0.01 # same scale as above #cpu_index_tuple_cost = 0.005 # same scale as above #cpu_operator_cost = 0.0025 # same scale as above -#parallel_setup_cost = 1000.0 # same scale as above +#parallel_setup_cost = 1000.0 # same scale as above #parallel_tuple_cost = 0.1 # same scale as above #min_parallel_table_scan_size = 8MB #min_parallel_index_scan_size = 512kB @@ -464,7 +489,7 @@ min_wal_size = 80MB #log_directory = 'log' # directory where log files are written, # can be absolute or relative to PGDATA #log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log' # log file name pattern, - # can include strftime() escapes + # can include strftime() escapes #log_file_mode = 0600 # creation mode for log files, # begin with 0 to use octal notation #log_rotation_age = 1d # Automatic rotation of logfiles will @@ -507,7 +532,7 @@ log_min_messages = info # values in order of decreasing detail: # fatal # panic -log_min_error_statement = error # values in order of decreasing detail: +#log_min_error_statement = error # values in order of decreasing detail: # debug5 # debug4 # debug3 @@ -603,12 +628,9 @@ log_line_prefix = '%t %q[%u@%d] ' # special values: # -1 disables, 0 logs all temp files log_timezone = 'Europe/Vienna' +# - Process Title - -#------------------------------------------------------------------------------ -# PROCESS TITLE -#------------------------------------------------------------------------------ - -cluster_name = '15/main' # added to process titles if nonempty +cluster_name = '17/main' # added to process titles if nonempty # (change requires restart) #update_process_title = on @@ -625,7 +647,7 @@ cluster_name = '15/main' # added to process titles if nonempty track_io_timing = on track_wal_io_timing = on #track_functions = none # none, pl, all -#stats_fetch_consistency = cache +#stats_fetch_consistency = cache # cache, none, snapshot # - Monitoring - @@ -645,24 +667,24 @@ track_wal_io_timing = on # requires track_counts to also be on. autovacuum_max_workers = 1 # max number of autovacuum subprocesses # (change requires restart) -autovacuum_naptime = 15min # time between autovacuum runs +autovacuum_naptime = 5min # time between autovacuum runs autovacuum_vacuum_threshold = 5000 # min number of row updates before # vacuum -autovacuum_vacuum_insert_threshold = 50000 # min number of row inserts - # before vacuum; -1 disables insert - # vacuums -autovacuum_analyze_threshold = 5000 # min number of row updates before +autovacuum_vacuum_insert_threshold = 100000 # min number of row inserts + # before vacuum; -1 disables insert + # vacuums +autovacuum_analyze_threshold = 500 # min number of row updates before # analyze #autovacuum_vacuum_scale_factor = 0.2 # fraction of table size before vacuum #autovacuum_vacuum_insert_scale_factor = 0.2 # fraction of inserts over table - # size before insert vacuum + # size before insert vacuum #autovacuum_analyze_scale_factor = 0.1 # fraction of table size before analyze autovacuum_freeze_max_age = 800000000 # maximum XID age before forced vacuum # (change requires restart) autovacuum_multixact_freeze_max_age = 1000000000 # maximum multixact age - # before forced vacuum - # (change requires restart) -autovacuum_vacuum_cost_delay = -1 # default vacuum cost delay for + # before forced vacuum + # (change requires restart) +#autovacuum_vacuum_cost_delay = 2ms # default vacuum cost delay for # autovacuum, in milliseconds; # -1 means use vacuum_cost_delay #autovacuum_vacuum_cost_limit = -1 # default vacuum cost limit for @@ -698,10 +720,11 @@ autovacuum_vacuum_cost_delay = -1 # default vacuum cost delay for #default_transaction_read_only = off #default_transaction_deferrable = off #session_replication_role = 'origin' -#statement_timeout = 0 # in milliseconds, 0 is disabled -#lock_timeout = 0 # in milliseconds, 0 is disabled +#statement_timeout = 0 # in milliseconds, 0 is disabled +#transaction_timeout = 0 # in milliseconds, 0 is disabled +#lock_timeout = 0 # in milliseconds, 0 is disabled #idle_in_transaction_session_timeout = 0 # in milliseconds, 0 is disabled -#idle_session_timeout = 0 # in milliseconds, 0 is disabled +#idle_session_timeout = 0 # in milliseconds, 0 is disabled #vacuum_freeze_table_age = 150000000 #vacuum_freeze_min_age = 50000000 #vacuum_failsafe_age = 1600000000 @@ -712,13 +735,15 @@ autovacuum_vacuum_cost_delay = -1 # default vacuum cost delay for #xmlbinary = 'base64' #xmloption = 'content' #gin_pending_list_limit = 4MB +#createrole_self_grant = '' # set and/or inherit +#event_triggers = on # - Locale and Formatting - datestyle = 'iso, dmy' #intervalstyle = 'postgres' timezone = 'Europe/Vienna' -#timezone_abbreviations = 'Default' # Select the set of available time zone +#timezone_abbreviations = 'Default' # Select the set of available time zone # abbreviations. Currently, there are # Default # Australia (historical usage) @@ -731,11 +756,14 @@ timezone = 'Europe/Vienna' # encoding # These settings are initialized by initdb, but they can be changed. -lc_messages = 'en_US.UTF-8' # locale for system error message +lc_messages = 'C.UTF8' # locale for system error message # strings -lc_monetary = 'en_US.UTF-8' # locale for monetary formatting -lc_numeric = 'en_US.UTF-8' # locale for number formatting -lc_time = 'en_US.UTF-8' # locale for time formatting +lc_monetary = 'C.UTF8' # locale for monetary formatting +lc_numeric = 'C.UTF8' # locale for number formatting +lc_time = 'C.UTF8' # locale for time formatting + +#icu_validation_level = warning # report ICU locale validation + # errors at the given level # default configuration for text search default_text_search_config = 'pg_catalog.english' @@ -744,7 +772,7 @@ default_text_search_config = 'pg_catalog.english' #local_preload_libraries = '' #session_preload_libraries = '' -#shared_preload_libraries = '' # (change requires restart) +#shared_preload_libraries = '' # (change requires restart) #jit_provider = 'llvmjit' # JIT library to use # - Other Defaults - @@ -767,7 +795,7 @@ deadlock_timeout = 15s #max_pred_locks_per_relation = -2 # negative values mean # (max_pred_locks_per_transaction # / -max_pred_locks_per_relation) - 1 -#max_pred_locks_per_page = 2 # min 0 +#max_pred_locks_per_page = 2 # min 0 #------------------------------------------------------------------------------ @@ -787,6 +815,7 @@ deadlock_timeout = 15s # - Other Platforms and Clients - #transform_null_equals = off +allow_alter_system = off #------------------------------------------------------------------------------ @@ -809,7 +838,7 @@ deadlock_timeout = 15s # default postgresql.conf. Note that these are directives, not variable # assignments, so they can usefully be given more than once. -include_dir = 'conf.d' # include files ending in '.conf' from +#include_dir = 'conf.d' # include files ending in '.conf' from # a directory, e.g., 'conf.d' #include_if_exists = '...' # include file only if it exists #include = '...' # include file -- 2.47.2