This is the multi-page printable view of this section. .
Client waits
- 1: Client: ClientRead
- 2: Client: ClientWrite
- 3: Client: GssOpenServer
- 4: Client: LibpqwalreceiverConnect
- 5: Client: LibpqwalreceiverReceive
- 6: Client: SslOpenServer
- 7: Client: WaitForStandbyConfirmation
- 8: Client: WalSenderWaitForWal
- 9: Client: WalSenderWriteData
Client flips the usual suspicion: PostgreSQL is ready to read, write, or complete a protocol step, and the remote side or network has not progressed. A large client-wait population is often normal for pooled idle connections.
State and transaction age decide severity
ClientRead plus state = 'idle' is expected. The same event with idle in transaction and an old xact_start can retain locks, snapshots, and dead tuples. ClientWrite on active sessions suggests the server cannot hand results to the consumer fast enough.
- Normal: idle pooled sessions waiting for the next command.
- Watch: old
idle in transaction, activeClientWrite, handshake waits, or application latency at the same time. - Urgent: clients stop consuming results, connection slots are exhausted, open transactions block cleanup, or a replication client disconnects repeatedly.
Events to recognize
| Event | First owner to contact |
|---|---|
| ClientRead | Application/connection pool |
| ClientWrite | Application consumer or network |
| GssOpenServer | Authentication/network path |
| SslOpenServer | TLS handshake path |
| LibpqwalreceiverReceive | Upstream primary/network |
| WalSenderWriteData | Standby or replication client |
Common misreads
- “Most sessions are in ClientRead” is not a database bottleneck without state, transaction age, and pool sizing.
- Cancelling an idle client does not fix an oversized pool; it only makes the pool reconnect.
ClientWritecan be caused by a slow consumer even when the database host network looks idle.- Replication-flavoured Client waits belong to the same protocol boundary but have different operational owners.
1 - Client: ClientRead
ClientRead
VersionsPG 13-18
Evidence2 source location(s)
Official description
Waiting to read data from the client
| PG 13 | PG 14 | PG 15 | PG 16 | PG 17 | PG 18 |
|---|---|---|---|---|---|
| ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
Trigger mechanism
WAIT_EVENT_CLIENT_READ at src/backend/libpq/be-secure.c:219 is the grep-verified reporting path. The public identity/resource is mapped at src/backend/utils/activity/wait_event_names.txt:85. The instrumented operation is: Waiting to read data from the client. The frontend protocol path reports ClientRead immediately before a socket, TLS/GSS, or replication-client operation blocks. PostgreSQL is waiting for the remote side or network to progress.
Normal or trouble?
- Normal: Idle ClientRead sessions are normal connection-pool inventory.
- Investigate: Investigate active writes, handshakes, old idle-in-transaction sessions, connection exhaustion, or replication-client stalls.
Diagnostic SQL
Response
- Check state and transaction age before counting the wait as load.
- Correlate with the owning application, pool, and network path.
- Fix consumer backpressure or pool policy rather than repeatedly terminating connections.
Source evidence
- PostgreSQL 18.6 · src/backend/libpq/be-secure.c:219 —
WAIT_EVENT_CLIENT_READ - PostgreSQL 18.6 · src/backend/utils/activity/wait_event_names.txt:85 —
CLIENT_READ
Related controls and signals
2 - Client: ClientWrite
ClientWrite
VersionsPG 13-18
Evidence2 source location(s)
Official description
Waiting to write data to the client
| PG 13 | PG 14 | PG 15 | PG 16 | PG 17 | PG 18 |
|---|---|---|---|---|---|
| ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
Trigger mechanism
WAIT_EVENT_CLIENT_WRITE at src/backend/libpq/be-secure.c:344 is the grep-verified reporting path. The public identity/resource is mapped at src/backend/utils/activity/wait_event_names.txt:86. The instrumented operation is: Waiting to write data to the client. The frontend protocol path reports ClientWrite immediately before a socket, TLS/GSS, or replication-client operation blocks. PostgreSQL is waiting for the remote side or network to progress.
Normal or trouble?
- Normal: Idle ClientRead sessions are normal connection-pool inventory.
- Investigate: Investigate active writes, handshakes, old idle-in-transaction sessions, connection exhaustion, or replication-client stalls.
Diagnostic SQL
Response
- Check state and transaction age before counting the wait as load.
- Correlate with the owning application, pool, and network path.
- Fix consumer backpressure or pool policy rather than repeatedly terminating connections.
Source evidence
- PostgreSQL 18.6 · src/backend/libpq/be-secure.c:344 —
WAIT_EVENT_CLIENT_WRITE - PostgreSQL 18.6 · src/backend/utils/activity/wait_event_names.txt:86 —
CLIENT_WRITE
Related controls and signals
3 - Client: GssOpenServer
GssOpenServer
VersionsPG 17-18
Evidence4 source location(s)
Official description
Waiting to read data from the client while establishing a GSSAPI session
| PG 13 | PG 14 | PG 15 | PG 16 | PG 17 | PG 18 |
|---|---|---|---|---|---|
| — | — | — | — | ✓ | ✓ |
Earlier names: Client/GSSOpenServer (PG 13-16)
Trigger mechanism
WAIT_EVENT_GSS_OPEN_SERVER at src/backend/libpq/be-secure-gssapi.c:461 is the grep-verified reporting path. The public identity/resource is mapped at src/backend/utils/activity/wait_event.c:277. The instrumented operation is: Waiting to read data from the client while establishing a GSSAPI session. The frontend protocol path reports GssOpenServer immediately before a socket, TLS/GSS, or replication-client operation blocks. PostgreSQL is waiting for the remote side or network to progress.
Normal or trouble?
- Normal: Idle ClientRead sessions are normal connection-pool inventory.
- Investigate: Investigate active writes, handshakes, old idle-in-transaction sessions, connection exhaustion, or replication-client stalls.
Diagnostic SQL
Response
- Check state and transaction age before counting the wait as load.
- Correlate with the owning application, pool, and network path.
- Fix consumer backpressure or pool policy rather than repeatedly terminating connections.
Source evidence
- PostgreSQL 16.15 · src/backend/libpq/be-secure-gssapi.c:461 —
WAIT_EVENT_GSS_OPEN_SERVER - PostgreSQL 16.15 · src/backend/utils/activity/wait_event.c:277 —
GSSOpenServer - PostgreSQL 18.6 · src/backend/libpq/be-secure-gssapi.c:462 —
WAIT_EVENT_GSS_OPEN_SERVER - PostgreSQL 18.6 · src/backend/utils/activity/wait_event_names.txt:87 —
GSS_OPEN_SERVER
Related controls and signals
4 - Client: LibpqwalreceiverConnect
LibpqwalreceiverConnect
VersionsPG 17-18
Evidence4 source location(s)
Official description
Waiting in WAL receiver to establish connection to remote server
| PG 13 | PG 14 | PG 15 | PG 16 | PG 17 | PG 18 |
|---|---|---|---|---|---|
| — | — | — | — | ✓ | ✓ |
Earlier names: Client/LibPQWalReceiverConnect (PG 13-16)
Trigger mechanism
WAIT_EVENT_LIBPQWALRECEIVER_CONNECT at src/backend/replication/libpqwalreceiver/libpqwalreceiver.c:231 is the grep-verified reporting path. The public identity/resource is mapped at src/backend/utils/activity/wait_event.c:280. The instrumented operation is: Waiting in WAL receiver to establish connection to remote server. The frontend protocol path reports LibpqwalreceiverConnect immediately before a socket, TLS/GSS, or replication-client operation blocks. PostgreSQL is waiting for the remote side or network to progress.
Normal or trouble?
- Normal: Idle ClientRead sessions are normal connection-pool inventory.
- Investigate: Investigate active writes, handshakes, old idle-in-transaction sessions, connection exhaustion, or replication-client stalls.
Diagnostic SQL
Response
- Check state and transaction age before counting the wait as load.
- Correlate with the owning application, pool, and network path.
- Fix consumer backpressure or pool policy rather than repeatedly terminating connections.
Source evidence
- PostgreSQL 16.15 · src/backend/replication/libpqwalreceiver/libpqwalreceiver.c:231 —
WAIT_EVENT_LIBPQWALRECEIVER_CONNECT - PostgreSQL 16.15 · src/backend/utils/activity/wait_event.c:280 —
LibPQWalReceiverConnect - PostgreSQL 18.6 · src/backend/replication/libpqwalreceiver/libpqwalreceiver.c:228 —
WAIT_EVENT_LIBPQWALRECEIVER_CONNECT - PostgreSQL 18.6 · src/backend/utils/activity/wait_event_names.txt:88 —
LIBPQWALRECEIVER_CONNECT
Related controls and signals
5 - Client: LibpqwalreceiverReceive
LibpqwalreceiverReceive
VersionsPG 17-18
Evidence4 source location(s)
Official description
Waiting in WAL receiver to receive data from remote server
| PG 13 | PG 14 | PG 15 | PG 16 | PG 17 | PG 18 |
|---|---|---|---|---|---|
| — | — | — | — | ✓ | ✓ |
Earlier names: Client/LibPQWalReceiverReceive (PG 13-16)
Trigger mechanism
WAIT_EVENT_LIBPQWALRECEIVER_RECEIVE at src/backend/replication/libpqwalreceiver/libpqwalreceiver.c:876 is the grep-verified reporting path. The public identity/resource is mapped at src/backend/utils/activity/wait_event.c:283. The instrumented operation is: Waiting in WAL receiver to receive data from remote server. The frontend protocol path reports LibpqwalreceiverReceive immediately before a socket, TLS/GSS, or replication-client operation blocks. PostgreSQL is waiting for the remote side or network to progress.
Normal or trouble?
- Normal: Idle ClientRead sessions are normal connection-pool inventory.
- Investigate: Investigate active writes, handshakes, old idle-in-transaction sessions, connection exhaustion, or replication-client stalls.
Diagnostic SQL
Response
- Check state and transaction age before counting the wait as load.
- Correlate with the owning application, pool, and network path.
- Fix consumer backpressure or pool policy rather than repeatedly terminating connections.
Source evidence
- PostgreSQL 16.15 · src/backend/replication/libpqwalreceiver/libpqwalreceiver.c:876 —
WAIT_EVENT_LIBPQWALRECEIVER_RECEIVE - PostgreSQL 16.15 · src/backend/utils/activity/wait_event.c:283 —
LibPQWalReceiverReceive - PostgreSQL 18.6 · src/backend/replication/libpqwalreceiver/libpqwalreceiver.c:258 —
WAIT_EVENT_LIBPQWALRECEIVER_RECEIVE - PostgreSQL 18.6 · src/backend/utils/activity/wait_event_names.txt:89 —
LIBPQWALRECEIVER_RECEIVE
Related controls and signals
6 - Client: SslOpenServer
SslOpenServer
VersionsPG 17-18
Evidence4 source location(s)
Official description
Waiting for SSL while attempting connection
| PG 13 | PG 14 | PG 15 | PG 16 | PG 17 | PG 18 |
|---|---|---|---|---|---|
| — | — | — | — | ✓ | ✓ |
Earlier names: Client/SSLOpenServer (PG 13-16)
Trigger mechanism
WAIT_EVENT_SSL_OPEN_SERVER at src/backend/libpq/be-secure-openssl.c:508 is the grep-verified reporting path. The public identity/resource is mapped at src/backend/utils/activity/wait_event.c:286. The instrumented operation is: Waiting for SSL while attempting connection. The frontend protocol path reports SslOpenServer immediately before a socket, TLS/GSS, or replication-client operation blocks. PostgreSQL is waiting for the remote side or network to progress.
Normal or trouble?
- Normal: Idle ClientRead sessions are normal connection-pool inventory.
- Investigate: Investigate active writes, handshakes, old idle-in-transaction sessions, connection exhaustion, or replication-client stalls.
Diagnostic SQL
Response
- Check state and transaction age before counting the wait as load.
- Correlate with the owning application, pool, and network path.
- Fix consumer backpressure or pool policy rather than repeatedly terminating connections.
Source evidence
- PostgreSQL 16.15 · src/backend/libpq/be-secure-openssl.c:508 —
WAIT_EVENT_SSL_OPEN_SERVER - PostgreSQL 16.15 · src/backend/utils/activity/wait_event.c:286 —
SSLOpenServer - PostgreSQL 18.6 · src/backend/libpq/be-secure-openssl.c:526 —
WAIT_EVENT_SSL_OPEN_SERVER - PostgreSQL 18.6 · src/backend/utils/activity/wait_event_names.txt:90 —
SSL_OPEN_SERVER
Related controls and signals
7 - Client: WaitForStandbyConfirmation
WaitForStandbyConfirmation
VersionsPG 17-18
Evidence2 source location(s)
Official description
Waiting for WAL to be received and flushed by the physical standby
| PG 13 | PG 14 | PG 15 | PG 16 | PG 17 | PG 18 |
|---|---|---|---|---|---|
| — | — | — | — | ✓ | ✓ |
Trigger mechanism
WAIT_EVENT_WAIT_FOR_STANDBY_CONFIRMATION at src/backend/replication/slot.c:3083 is the grep-verified reporting path. The public identity/resource is mapped at src/backend/utils/activity/wait_event_names.txt:91. The instrumented operation is: Waiting for WAL to be received and flushed by the physical standby. The frontend protocol path reports WaitForStandbyConfirmation immediately before a socket, TLS/GSS, or replication-client operation blocks. PostgreSQL is waiting for the remote side or network to progress.
Normal or trouble?
- Normal: Idle ClientRead sessions are normal connection-pool inventory.
- Investigate: Investigate active writes, handshakes, old idle-in-transaction sessions, connection exhaustion, or replication-client stalls.
Diagnostic SQL
Response
- Check state and transaction age before counting the wait as load.
- Correlate with the owning application, pool, and network path.
- Fix consumer backpressure or pool policy rather than repeatedly terminating connections.
Source evidence
- PostgreSQL 18.6 · src/backend/replication/slot.c:3083 —
WAIT_EVENT_WAIT_FOR_STANDBY_CONFIRMATION - PostgreSQL 18.6 · src/backend/utils/activity/wait_event_names.txt:91 —
WAIT_FOR_STANDBY_CONFIRMATION
Related controls and signals
8 - Client: WalSenderWaitForWal
WalSenderWaitForWal
VersionsPG 17-18
Evidence4 source location(s)
Official description
Waiting for WAL to be flushed in WAL sender process
| PG 13 | PG 14 | PG 15 | PG 16 | PG 17 | PG 18 |
|---|---|---|---|---|---|
| — | — | — | — | ✓ | ✓ |
Earlier names: Client/WalSenderWaitForWAL (PG 13-16)
Trigger mechanism
WAIT_EVENT_WAL_SENDER_WAIT_WAL at src/backend/replication/walsender.c:1714 is the grep-verified reporting path. The public identity/resource is mapped at src/backend/utils/activity/wait_event.c:289. The instrumented operation is: Waiting for WAL to be flushed in WAL sender process. The frontend protocol path reports WalSenderWaitForWal immediately before a socket, TLS/GSS, or replication-client operation blocks. PostgreSQL is waiting for the remote side or network to progress.
Normal or trouble?
- Normal: Idle ClientRead sessions are normal connection-pool inventory.
- Investigate: Investigate active writes, handshakes, old idle-in-transaction sessions, connection exhaustion, or replication-client stalls.
Diagnostic SQL
Response
- Check state and transaction age before counting the wait as load.
- Correlate with the owning application, pool, and network path.
- Fix consumer backpressure or pool policy rather than repeatedly terminating connections.
Source evidence
- PostgreSQL 16.15 · src/backend/replication/walsender.c:1714 —
WAIT_EVENT_WAL_SENDER_WAIT_WAL - PostgreSQL 16.15 · src/backend/utils/activity/wait_event.c:289 —
WalSenderWaitForWAL - PostgreSQL 18.6 · src/backend/replication/walsender.c:1813 —
WAIT_EVENT_WAL_SENDER_WAIT_FOR_WAL - PostgreSQL 18.6 · src/backend/utils/activity/wait_event_names.txt:92 —
WAL_SENDER_WAIT_FOR_WAL
Related controls and signals
9 - Client: WalSenderWriteData
WalSenderWriteData
VersionsPG 13-18
Evidence2 source location(s)
Official description
Waiting for any activity when processing replies from WAL receiver in WAL sender process
| PG 13 | PG 14 | PG 15 | PG 16 | PG 17 | PG 18 |
|---|---|---|---|---|---|
| ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
Trigger mechanism
WAIT_EVENT_WAL_SENDER_WRITE_DATA at src/backend/replication/walsender.c:1653 is the grep-verified reporting path. The public identity/resource is mapped at src/backend/utils/activity/wait_event_names.txt:93. The instrumented operation is: Waiting for any activity when processing replies from WAL receiver in WAL sender process. The frontend protocol path reports WalSenderWriteData immediately before a socket, TLS/GSS, or replication-client operation blocks. PostgreSQL is waiting for the remote side or network to progress.
Normal or trouble?
- Normal: Idle ClientRead sessions are normal connection-pool inventory.
- Investigate: Investigate active writes, handshakes, old idle-in-transaction sessions, connection exhaustion, or replication-client stalls.
Diagnostic SQL
Response
- Check state and transaction age before counting the wait as load.
- Correlate with the owning application, pool, and network path.
- Fix consumer backpressure or pool policy rather than repeatedly terminating connections.
Source evidence
- PostgreSQL 18.6 · src/backend/replication/walsender.c:1653 —
WAIT_EVENT_WAL_SENDER_WRITE_DATA - PostgreSQL 18.6 · src/backend/utils/activity/wait_event_names.txt:93 —
WAL_SENDER_WRITE_DATA