# Client waits

> PostgreSQL waiting for an application, network socket, TLS/GSS handshake, or replication client.
---

`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 {#how-to-read}

`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`, active `ClientWrite`, 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 {#top-events}

| Event | First owner to contact |
| --- | --- |
| [ClientRead](client-read/) | Application/connection pool |
| [ClientWrite](client-write/) | Application consumer or network |
| [GssOpenServer](gss-open-server/) | Authentication/network path |
| [SslOpenServer](ssl-open-server/) | TLS handshake path |
| [LibpqwalreceiverReceive](libpqwalreceiver-receive/) | Upstream primary/network |
| [WalSenderWriteData](wal-sender-write-data/) | Standby or replication client |

## Common misreads {#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.
- `ClientWrite` can 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.

---

Section pages:

- [Client: ClientRead](/client/client-read/): Waiting to read data from the client
- [Client: ClientWrite](/client/client-write/): Waiting to write data to the client
- [Client: GssOpenServer](/client/gss-open-server/): Waiting to read data from the client while establishing a GSSAPI session
- [Client: LibpqwalreceiverConnect](/client/libpqwalreceiver-connect/): Waiting in WAL receiver to establish connection to remote server
- [Client: LibpqwalreceiverReceive](/client/libpqwalreceiver-receive/): Waiting in WAL receiver to receive data from remote server
- [Client: SslOpenServer](/client/ssl-open-server/): Waiting for SSL while attempting connection
- [Client: WaitForStandbyConfirmation](/client/wait-for-standby-confirmation/): Waiting for WAL to be received and flushed by the physical standby
- [Client: WalSenderWaitForWal](/client/wal-sender-wait-for-wal/): Waiting for WAL to be flushed in WAL sender process
- [Client: WalSenderWriteData](/client/wal-sender-write-data/): Waiting for any activity when processing replies from WAL receiver in WAL sender process
