postgresql: dynamic memory configuration

This commit is contained in:
Jérémy Lecour 2017-05-20 00:23:21 +02:00
parent 27e9eaba55
commit 283953a69f
2 changed files with 4 additions and 2 deletions

View file

@ -3,10 +3,10 @@
postgresql_databases: []
# Tuning
postgresql_shared_buffers: 4GB
postgresql_shared_buffers: "{{ (ansible_memtotal_mb * 0.25) | int }}MB"
postgresql_work_mem: 8MB
postgresql_random_page_cost: 1.5
postgresql_effective_cache_size: 14GB
postgresql_effective_cache_size: "{{ (ansible_memtotal_mb * 0.5) | int }}MB"
# PostgreSQL version
postgresql_version: '9.4'

View file

@ -21,3 +21,5 @@
group: postgres
mode: "0644"
notify: restart postgresql
- meta: flush_handlers