fix autotuning

This commit is contained in:
ace 2024-01-31 11:38:11 +03:00
parent adab430df7
commit 6f18db44d2
Signed by: ace
GPG Key ID: 2C08973DD37A76FD

View File

@ -122,9 +122,9 @@ patroni_postgresql_default_parameters:
shared_buffers: "{{ (ansible_memory_mb.real.total * 0.25) | round | int }}MB" shared_buffers: "{{ (ansible_memory_mb.real.total * 0.25) | round | int }}MB"
max_worker_processes: "{{ ansible_processor_vcpus }}" max_worker_processes: "{{ ansible_processor_vcpus }}"
max_parallel_workers: "{{ ansible_processor_vcpus }}" max_parallel_workers: "{{ ansible_processor_vcpus }}"
max_parallel_workers_per_gather: "{{ (ansible_processor_vcpus / 2) | round | int }}" max_parallel_workers_per_gather: "{{ ((ansible_processor_vcpus / 2) | round | int) if ansible_processor_vcpus > 1 else ansible_processor_vcpus }}"
max_parallel_maintenance_workers: "{{ (ansible_processor_vcpus / 2) | round | int }}" max_parallel_maintenance_workers: "{{ ((ansible_processor_vcpus / 2) | round | int) if ansible_processor_vcpus > 1 else ansible_processor_vcpus }}"
work_mem: "{{ (((ansible_memory_mb.real.total - ((ansible_memory_mb.real.total * 0.25) | round | int)) / (patroni_postgresql_max_connections | int * 3) / ((ansible_processor_vcpus / 2) | round | int)) + 4) | round | int }}MB" work_mem: "{{ (((ansible_memory_mb.real.total - ((ansible_memory_mb.real.total * 0.25) | round | int)) / (patroni_postgresql_max_connections | int * 3) / (((ansible_processor_vcpus / 2) | round | int) if ansible_processor_vcpus > 1 else ansible_processor_vcpus)) + 4) | round | int }}MB"
maintenance_work_mem: "{{ (ansible_memory_mb.real.total * 0.0625) | round | int }}MB" maintenance_work_mem: "{{ (ansible_memory_mb.real.total * 0.0625) | round | int }}MB"
effective_cache_size: "{{ (ansible_memory_mb.real.total * 0.8) | round | int }}MB" effective_cache_size: "{{ (ansible_memory_mb.real.total * 0.8) | round | int }}MB"
checkpoint_timeout: "15min" checkpoint_timeout: "15min"