diff --git a/defaults/main.yaml b/defaults/main.yaml index 1d4630c..fed07ab 100644 --- a/defaults/main.yaml +++ b/defaults/main.yaml @@ -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' }}"