store-db: applying postgres system setting based on the stage

Signed-off-by: Alexis Pentori <alexis@status.im>
This commit is contained in:
Alexis Pentori 2024-08-08 12:23:43 +02:00
parent f85fc71b50
commit af9162fc2e
No known key found for this signature in database
GPG Key ID: 65250D2801E47A10
1 changed files with 23 additions and 18 deletions

View File

@ -25,13 +25,18 @@ postgres_ha_databases:
pass: '{{lookup("bitwarden", "fleets/status/"+stage+"/db/nim-waku")}}' pass: '{{lookup("bitwarden", "fleets/status/"+stage+"/db/nim-waku")}}'
# Avoid exceeding volume size with WAL log. # Avoid exceeding volume size with WAL log.
postgres_ha_alter_system_settings: postgres_ha_alter_system_settings: '{{ postgres_system_setting_default | combine(postgres_system_setting_stage[stage])}}'
postgres_system_setting_default:
checkpoint_timeout: '5min' checkpoint_timeout: '5min'
max_wal_size: '1GB' max_wal_size: '1GB'
min_wal_size: '80MB' min_wal_size: '80MB'
max_locks_per_transaction: '2160' max_locks_per_transaction: '2160'
autovacuum_work_mem: '{{ ((ansible_memtotal_mb * 0.1) * 1000) | int }}' # kB autovacuum_work_mem: '{{ ((ansible_memtotal_mb * 0.1) * 1000) | int }}' # kB
postgres_system_setting_stage:
staging: {}
prod:
## The following are obtained from https://pgtune.leopard.in.ua/ (8GB RAM 4CPUs SSD PG version 15) ## The following are obtained from https://pgtune.leopard.in.ua/ (8GB RAM 4CPUs SSD PG version 15)
max_connections: '300' max_connections: '300'
shared_buffers: '2GB' shared_buffers: '2GB'