fix autotuning

This commit is contained in:
ace 2024-01-31 11:37:48 +03:00
parent c598622364
commit 7b924b24dd
Signed by: ace
GPG Key ID: 2C08973DD37A76FD

View File

@ -47,9 +47,9 @@ postgresql_default_parameters:
dynamic_shared_memory_type: 'posix'
max_worker_processes: '{{ ansible_processor_vcpus }}'
max_parallel_workers: '{{ ansible_processor_vcpus }}'
max_parallel_workers_per_gather: '{{ (ansible_processor_vcpus / 2) | round | int }}'
max_parallel_maintenance_workers: '{{ (ansible_processor_vcpus / 2) | round | int }}'
work_mem: '{{ (((ansible_memory_mb.real.total - ((ansible_memory_mb.real.total * 0.25) | round | int)) / (postgresql_max_connections | int * 3) / ((ansible_processor_vcpus / 2) | round | int)) + 4) | round | int }}MB'
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) 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)) / (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'
effective_cache_size: '{{ (ansible_memory_mb.real.total * 0.8) | round | int }}MB'
random_page_cost: "{{ '1.1' if postgresql_storage_type == 'ssd' else '4' }}"