Skip to content

Explain low wal_sender_timeout - #6946

Merged
nidhibhammar merged 3 commits into
developfrom
dev/pe/explain-wal_sender_timeout
Aug 21, 2025
Merged

nidhibhammar merged 3 commits into
developfrom
dev/pe/explain-wal_sender_timeout

Conversation

@eatonphil

Copy link
Copy Markdown
Contributor

No description provided.

@eatonphil
eatonphil requested a review from a team as a code owner August 20, 2025 16:08
- `max_wal_senders` — Two needed for every peer node.
- `max_replication_slots` — Two needed for every peer node.
- `wal_sender_timeout` and `wal_receiver_timeout` — Determines how
- `wal_sender_timeout` and `wal_receiver_timeout` — The default of one minute is usually sufficient, but large transactions may require longer than this amount of time to process. Since the wal sender must process the full size of the transaction before transmitting it to a waiting replication connection, Postgres can see that as a timeout. If the problem is actually due to a large transaction, raising wal_sender_timeout to a higher value, like 3600 seconds or higher, and reloading the server could solve the problem. Additionally, this setting determines how

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would capitalize "WAL". Would be good to give an example of how to change these values on a running node:

ALTER SYSTEM RESET wal_sender_timeout;
ALTER SYSTEM RESET wal_receiver_timeout;
SELECT pg_reload_conf();

But not sure if this is the right place for it -- up to you.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(To change them persistently I guess you have to change postgres.conf, but commands for change at runtime are a handy trick.)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Also I'd say '1h' or '3600s' to stick with actual config syntax, just to avoid confusion.)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed the capitalization and the value, thank you!

@nidhibhammar
nidhibhammar merged commit fe96702 into develop Aug 21, 2025
@nidhibhammar
nidhibhammar deleted the dev/pe/explain-wal_sender_timeout branch August 21, 2025 13:12
- `max_wal_senders` — Two needed for every peer node.
- `max_replication_slots` — Two needed for every peer node.
- `wal_sender_timeout` and `wal_receiver_timeout` — Determines how
- `wal_sender_timeout` and `wal_receiver_timeout` — The default of one minute is usually sufficient, but large transactions may require longer than this amount of time to process. Since the WAL sender must process the full size of the transaction before transmitting it to a waiting replication connection, Postgres can see that as a timeout. If the problem is actually due to a large transaction, raising wal_sender_timeout to a higher value, like `3600s` or higher, and reloading the server could solve the problem. Additionally, this setting determines how

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should mention that we always use keepalive to handle networking problems regardless of wal_sender_timeout

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants