From 72424c52fbe4e5e368f707350cda4a77ec880f46 Mon Sep 17 00:00:00 2001 From: Kevin Fenzi Date: Aug 05 2020 23:28:08 +0000 Subject: postgresql / db-koji01: allow adjusting max_workers and friends db-koji01 has been running with this since before the mass rebuild, and it seems to make it have a higher load, but process faster and without stalling when doing backups or when long/bad koji-gc queries for old versions of texlive hit it. Signed-off-by: Kevin Fenzi --- diff --git a/inventory/host_vars/db-koji01.iad2.fedoraproject.org b/inventory/host_vars/db-koji01.iad2.fedoraproject.org index ff0960b..f1436e9 100644 --- a/inventory/host_vars/db-koji01.iad2.fedoraproject.org +++ b/inventory/host_vars/db-koji01.iad2.fedoraproject.org @@ -43,8 +43,12 @@ custom_rules: [ nrpe_procs_warn: 600 nrpe_procs_crit: 700 -# we backup the backup on db-koji01 until we can replace now db_backup_dir: ['/backups'] shared_buffers: "32GB" effective_cache_size: "100GB" max_stack_depth: "6MB" + +max_worker_processes: 64 +max_parallel_workers_per_gather: 32 +max_parallel_maintenance_workers: 8 +max_parallel_workers: 64 diff --git a/roles/postgresql_server/templates/postgresql.conf-12 b/roles/postgresql_server/templates/postgresql.conf-12 index 8bfe6dc..2c20622 100644 --- a/roles/postgresql_server/templates/postgresql.conf-12 +++ b/roles/postgresql_server/templates/postgresql.conf-12 @@ -207,6 +207,18 @@ dynamic_shared_memory_type = posix # the default is the first option #parallel_leader_participation = on #max_parallel_workers = 8 # maximum number of max_worker_processes that # can be used in parallel operations +{% if max_worker_processes is defined %} +max_worker_processes = {{ max_worker_processes }} +{% endif %} +{% if max_parallel_workers_per_gather is defined %} +max_parallel_workers_per_gather = {{ max_parallel_workers_per_gather }} +{% endif %} +{% if max_parallel_maintenance_workers is defined %} +max_parallel_maintenance_workers = {{ max_parallel_maintenance_workers }} +{% endif %} +{% if max_parallel_workers is defined %} +max_parallel_workers = {{ max_parallel_workers }} +{% endif %} #old_snapshot_threshold = -1 # 1min-60d; -1 disables; 0 is immediate # (change requires restart) #backend_flush_after = 0 # measured in pages, 0 disables