mirror of
https://gitea.0xace.cc/ansible-galaxy/postgresql.git
synced 2025-04-05 16:21:56 +00:00
more autotuning
This commit is contained in:
parent
c8e0761c07
commit
c598622364
@ -34,11 +34,13 @@ postgresql_recovery_target_time: ""
|
|||||||
postgresql_promote_trigger_file: "{{ postgresql_data_dir }}/promote.trigger"
|
postgresql_promote_trigger_file: "{{ postgresql_data_dir }}/promote.trigger"
|
||||||
|
|
||||||
postgresql_password_encryption_algorithm: "scram-sha-256"
|
postgresql_password_encryption_algorithm: "scram-sha-256"
|
||||||
|
postgresql_max_connections: '1000'
|
||||||
|
postgresql_storage_type: 'ssd'
|
||||||
postgresql_default_parameters:
|
postgresql_default_parameters:
|
||||||
data_directory: '{{ postgresql_data_dir }}'
|
data_directory: '{{ postgresql_data_dir }}'
|
||||||
archive_mode: "{{ postgresql_archive_mode | default('on') }}"
|
archive_mode: "{{ postgresql_archive_mode | default('on') }}"
|
||||||
listen_addresses: '*'
|
listen_addresses: '*'
|
||||||
max_connections: '1000'
|
max_connections: '{{ postgresql_max_connections }}'
|
||||||
superuser_reserved_connections: '5'
|
superuser_reserved_connections: '5'
|
||||||
shared_buffers: '{{ (ansible_memory_mb.real.total * 0.25) | round | int }}MB'
|
shared_buffers: '{{ (ansible_memory_mb.real.total * 0.25) | round | int }}MB'
|
||||||
huge_pages: 'try'
|
huge_pages: 'try'
|
||||||
@ -47,8 +49,14 @@ postgresql_default_parameters:
|
|||||||
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 }}'
|
||||||
max_parallel_maintenance_workers: '{{ (ansible_processor_vcpus / 2) | round | int }}'
|
max_parallel_maintenance_workers: '{{ (ansible_processor_vcpus / 2) | round | int }}'
|
||||||
max_wal_size: '1GB'
|
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'
|
||||||
min_wal_size: '80MB'
|
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' }}"
|
||||||
|
effective_io_concurrency: "{{ '200' if postgresql_storage_type == 'ssd' else '2' }}"
|
||||||
|
min_wal_size: '1GB'
|
||||||
|
max_wal_size: '4GB'
|
||||||
|
wal_buffers: '16MB'
|
||||||
log_destination: 'stderr'
|
log_destination: 'stderr'
|
||||||
logging_collector: 'on'
|
logging_collector: 'on'
|
||||||
log_directory: 'log'
|
log_directory: 'log'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user