mirror of
https://gitea.0xace.cc/ansible-galaxy/postgresql.git
synced 2025-01-18 12:02:25 +00:00
fix autotuning
This commit is contained in:
parent
c598622364
commit
7b924b24dd
@ -47,9 +47,9 @@ postgresql_default_parameters:
|
|||||||
dynamic_shared_memory_type: 'posix'
|
dynamic_shared_memory_type: 'posix'
|
||||||
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)) / (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)) / (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'
|
||||||
random_page_cost: "{{ '1.1' if postgresql_storage_type == 'ssd' else '4' }}"
|
random_page_cost: "{{ '1.1' if postgresql_storage_type == 'ssd' else '4' }}"
|
||||||
|
Loading…
Reference in New Issue
Block a user