Patroni/Postgres configuration difference
Between the actual master and the patroni cluster leader, there are a few configuration differences that we might need to address before switching to the new architecture. Bellow the variables that have differences and that have impact in the way that postgres work:
~/ongres/Gitlab ᐅ diff -y patroni postgres
checkpoint_completion_target|0.5 | checkpoint_completion_target|0.7
log_destination|syslog | log_destination|stderr
tcp_keepalives_count|9 | tcp_keepalives_count|0
tcp_keepalives_idle|300 | tcp_keepalives_idle|0
tcp_keepalives_interval|75 | tcp_keepalives_interval|0
wal_log_hints|on | wal_log_hints|off
Recommended:
- checkpoint_completion_target should be 0.7 in Patroni either, this affects segment usability and consequently impacts on write performance.
- Regarding log_destination, both modes are the same although I'm just pointing this difference to check if this has been addressed differently as it is implemented in production. @ahmadsherif
- wal_log_hints is recommended to be on and it only outputs warnings in the log if checkpoints are occurring too often (noticing the admins to increase the
max_wal_size). This does not impact performance if turned off, so is not critical this setup. - TCP settings differ between Postgres and Patroni, although, the Patroni configuration applies the current default settings in production. It can be considered more consistent the new approach, of non relying on OS settings and applying custom db ones.
(TCP conf in current master)
root@postgres-03-db-gprd.c.gitlab-production.internal:~# sysctl -A | grep tcp | grep keepalive
net.ipv4.tcp_keepalive_intvl = 75
net.ipv4.tcp_keepalive_probes = 9
net.ipv4.tcp_keepalive_time = 300