Skip to main content

Top Wait Events

The Top Wait Events panel displays the top 10 wait events observed across all ASH samples in the selected time window. It is a ranked table that helps you understand what your database sessions were waiting for during the selected period.

Top Wait Events


Understanding Wait Events

In PostgreSQL, a session that is not actively using CPU is in a wait state. PMP4PG captures the wait event type and wait event from pg_stat_activity in every ASH sample, then groups them into Wait Classes for easier analysis.

Wait Class Mapping

Wait ClassColorPostgreSQL wait_event_type values
CPU🟢 GreenNULL or empty — session is on CPU
I/O🔵 BlueIO
Lock🔴 RedLock, LWLock
Network/Client🟠 OrangeClient, IPC
Idle⚪ GrayTimeout
Activity🟡 YellowActivity
Buffer🟣 PurpleBufferPin
Other⚫ Dark GrayAny other value

Top Wait Events Table

The table lists up to 10 wait events, sortable by any column:

ColumnDescription
AASAverage Active Sessions — average number of sessions in this wait state during the selected period
% TotalPercentage of total DB time attributed to this wait event
Wait ClassHigh-level grouping (CPU, I/O, Lock, Network/Client, Idle, Activity, Buffer, Other)
Event TypePostgreSQL wait_event_type value (e.g. IO, LWLock, Lock, Client, Timeout)
Wait EventSpecific wait event name (e.g. WALWrite, transactionid, ClientRead)
SamplesNumber of ASH samples with this wait event
OccurrencesNumber of distinct occurrences observed

Use the Search wait event box above the table to filter by wait event name or event type.


Known Wait Events Reference

Wait ClassEvent TypeWait EventTypical Cause
CPUSession actively executing on CPU
I/OIODataFileReadReading data blocks from disk (cache miss)
I/OIODataFileWriteWriting data blocks to disk
I/OIODataFileExtendExtending a relation file
I/OIODataFilePrefetchPrefetching data blocks
I/OIOWALWriteWriting WAL records to disk
I/OIOWALSyncSyncing WAL to disk (fsync)
I/OIOWALInitSyncInitializing a new WAL segment
I/OIOBufFileReadReading from a temporary buffer file
I/OIOBufFileWriteWriting to a temporary buffer file
LockLockrelationWaiting for a table-level lock
LockLocktransactionidWaiting for another transaction to commit
LockLocktupleWaiting for a row-level lock
LockLWLockWALInsertContention inserting WAL records
LockLWLockWALWriteContention writing WAL
LockLWLockBufferContentContention accessing a buffer page
LockLWLockProcArrayContention on the process array
LockLWLockLockManagerContention on the lock manager
LockLWLockXidGenContention generating transaction IDs
LockLWLockXactSLRUContention on transaction status cache
Network/ClientClientClientReadWaiting for client to send data
Network/ClientIPCXactGroupUpdateWaiting for group transaction commit
IdleTimeoutVacuumDelayAutovacuum cost-based delay
IdleTimeoutVacuumTruncateWaiting to truncate relation after vacuum
IdleTimeoutPgSleepSession sleeping (pg_sleep())
IdleTimeoutSpinDelaySpinlock retry delay
OtherExtensionExtensionWait event from a PostgreSQL extension

Reading the Results

Predominantly CPU

A high AAS on CPU with no significant waits indicates a compute-bound workload. This is healthy for analytical queries but may signal missing indexes for OLTP workloads.

High Lock Waits

Lock contention (transactionid, relation, tuple) indicates sessions blocking each other. Keep transactions short and investigate long-running transactions.

High WALWrite / WALSync Waits

Sessions waiting on WAL writes suggest the WAL disk is a bottleneck. Consider a dedicated WAL volume or review synchronous_commit settings.

High ClientRead Waits

Sessions waiting for the client indicate the application is slow to send queries or consume results — investigate the application layer, not the database.

High VacuumDelay Waits

Autovacuum is running but being throttled by cost-based delay settings. If bloat is accumulating, consider increasing autovacuum_vacuum_cost_limit.


Next Steps