Author finds Postgres replica lag reduced by tuning archive_timeout and wal_retrieve_retry_interval

clickhouse.com12 min read

An investigation into Postgres read replica lag reveals that low write traffic actually causes unexpected delays due to default WAL archiving intervals, creating a U-shaped curve of replication latency. The author demonstrates that adjusting parameters like archive_timeout and wal_retrieve_retry_interval can significantly reduce replica lag in low-throughput scenarios, though these changes introduce trade-offs involving network overhead and CPU usage. Open article →