buffer_io
Waiting for I/O on a data page.
Additional Information​
The server process is waiting for a lightweight lock (LWLock
). LWLocks
are similar to latches in other database systems. Most such locks protect a particular data structure in shared memory. There is no order to the granting of LWLocks
and in a high concurrency system this can cause contention. In this case an disk IO has been issued and we are waiting for it to complete so it can be written into shared_buffer
memory.
How to reduce this wait​
This is a very common wait as it forms part of any query.
- Compare with your baseline to see if this is exceptional or normal workload.
- Check for many processes accessing the same resources concurrently.
- Ensure the execution path of your query is efficient as possible.
Additional Links​
PostgreSQL documentation - 27.2. The Statistics Collector
habr.com - Locks in PostgreSQL: 4. Locks in memory
Search online​
If this article doesn't have the information you need you can try searching online. Remember, you can contribute suggestions to this page.