Jakub Sokołowski f32d99fb06
store-db: increase consul alert tresholds
Signed-off-by: Jakub Sokołowski <jakub@status.im>
2024-08-11 15:24:26 +02:00

72 lines
2.7 KiB
YAML

---
# Custom SSH accounts, should start from UID 8000.
bootstrap__active_extra_users:
- { name: ivan, uid: 8000, groups: ['docker', 'dockremap'], key: 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJBdm8y1PfWjT1pioaWJSZ2ETrUySb+dS/ifDg+VIpLY ivansete@status.im' }
- { name: hanno, uid: 8001, groups: ['docker', 'dockremap'], key: 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPoFi19qWnAkvVdfzQQrPtXBozfeBEekoycGKIEdZarj hanno@status.im' }
- { name: tanya, uid: 8002, groups: ['docker', 'dockremap'], key: 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIH9UsceZPWz8Lhtxbvo8ximWZnaSbOTqvl/tWrZ6enja tanya@status.im' }
postgres_ha_service_name: 'nim-waku-store-db'
postgres_ha_cont_image: 'postgres:15.1-alpine'
postgres_ha_is_master: true
postgres_ha_replica_enabled: false
postgres_ha_replica_allowed_addresses: []
postgres_ha_admin_user: 'postgres'
postgres_ha_admin_pass: '{{lookup("bitwarden", "fleets/status/"+stage+"/db/admin")}}'
# Disable backups since we have multiple DCs
postgres_ha_backup: false
postgres_ha_backup_enabled: false
postgres_ha_databases:
- name: 'nim-waku'
user: 'nim-waku'
pass: '{{lookup("bitwarden", "fleets/status/"+stage+"/db/nim-waku")}}'
# Avoid exceeding volume size with WAL log.
postgres_ha_alter_system_settings: '{{ postgres_system_setting_default | combine(postgres_system_setting_stage[stage])}}'
postgres_system_setting_default:
checkpoint_timeout: '5min'
max_wal_size: '1GB'
min_wal_size: '80MB'
max_locks_per_transaction: '2160'
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)
max_connections: '300'
shared_buffers: '2GB'
effective_cache_size: '6GB'
maintenance_work_mem: '512MB'
checkpoint_completion_target: '0.9'
wal_buffers: '16MB'
default_statistics_target: '100'
random_page_cost: '1.1'
effective_io_concurrency: '200'
work_mem: '3495kB'
huge_pages: 'off'
min_wal_size: '2GB'
max_wal_size: '8GB'
max_worker_processes: '4'
max_parallel_workers_per_gather: '2'
max_parallel_workers: '4'
max_parallel_maintenance_workers: '2'
# Consul
postgres_ha_consul_check_interval: '60s'
postgres_ha_consul_check_timeout: '5s'
postgres_ha_consul_success_before_passing: 1
postgres_ha_consul_failures_before_warning: 5
postgres_ha_consul_failures_before_critical: 10
# Open PostgreSQL Port
open_ports_default_comment: '{{ postgres_ha_service_name }}'
open_ports_default_chain: 'SERVICES'
open_ports_default_protocol: 'tcp'
open_ports_list:
- { port: '{{ postgres_ha_cont_port }}', ipset: '{{ env }}.{{ stage }}' }