WALWrite

The WALWrite event occurs when a backend process is waiting for the PostgreSQL WAL buffers to be written out to the operating system's write cache.

The Difference Between WALWrite and WALSync

WALWrite: Waiting for the data to be moved from PostgreSQL's internal buffers to the OS kernel buffer.
WALSync: Waiting for the OS to move the data to be from the OS kernel buffer to the physical disk.

Common Causes of High WALWrite Wait Times

When WALWrite becomes a bottleneck, it is usually due to one of the following factors:

Additional troubleshooting

You should also check your system-level I/O metrics (using tools like iostat or iotop) to see if the disk write latency is spiking.

Strategies for Optimization