More Load Is Faster: Tuning Postgres Read Replicas
ClickHouse, Tuesday, November 17th, 2026
A ClickHouse engineer tests WAL-archive-based Postgres read replicas and finds lag is worst at very low and very high write load.
A ClickHouse engineer tested read replica lag on ClickHouse Managed Postgres, which by default keeps replicas in sync from archived WAL rather than streaming replication.
Because Postgres switches WAL segments every 16MB or 60 seconds, low write traffic can leave a replica up to 60 seconds behind, while moderate load of 12MB/s gave about 3 seconds of lag; very high throughput also raised lag as archive upload fell behind.
Lowering archive_timeout and wal_retrieve_retry_interval reduced lag until each poll's roughly 0.8s of WAL-G calls became the limit.
The author suggests archive_timeout=5s and wal_retrieve_retry_interval=500ms as a relatively safe starting point and warns of higher network costs with synchronous HA and extra replica CPU.