As described in the previous post , the primary now uses a high-I/O Ultra disk. Reads and writes took fractions of a millisecond, yet PostgreSQL WAL synchronization averaged 25-30 ms. Removing synchronous-standby waits didn't help: synchronous_commit=local still requires local WAL durability. With device-read constraints reduced and remote acknowledgments excluded, I traced the primary's synchronization call across the guest-OS boundary.
To investigate those durable-commit timings, I returned to synchronous_commit=on with normal HA for a full repeat, then used a separate pilot prepared for controller tracing.
Measure the synchronization, not only the disk
The relevant cumulative PostgreSQL counters are:
SELECT wal_write , wal_sync , wal_write_time , wal_sync_time , stats_reset FROM pg_stat_wal ;
Enter fullscreen mode
Exit fullscreen mode
With track_wal_io_timing=on , the interval mean is:
mean WAL sync ms = delta(wal_sync_time) / delta(wal_sync)
Enter fullscreen mode
Exit fullscreen mode
The full…