Skip to content

Commit 2e92099

Browse files
fixup! Should I reduce the REST publish timeout?
1 parent b6089b8 commit 2e92099

File tree

1 file changed

+17
-14
lines changed

1 file changed

+17
-14
lines changed

src/pages/docs/pub-sub/index.mdx

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -441,20 +441,23 @@ if err := channel.Publish(context.Background(), "example", "message data"); err
441441

442442
REST publish operations have a default 10-second timeout. While you may consider reducing this timeout for faster failure feedback, be aware that this can create problems:
443443

444-
**Why short timeouts can be problematic:**
445-
- Most requests that exceed short timeouts (e.g., <1s) still succeed with normal latency
446-
- Retrying typically doesn't speed up message delivery and creates additional system load
447-
- During high load or scaling operations, retry storms can worsen performance
448-
- You'll miss important error notifications (rate limits, channel limits) if requests timeout prematurely
449-
450-
**The default 10-second timeout is designed to:**
451-
- Account for channel activation latency in multi-region deployments
452-
- Handle network and processing queue variations
453-
- Provide reliable error reporting for legitimate failures
454-
455-
**When to consider timeout adjustments:**
456-
- Use `httpOpenTimeout` (default 4s) for connection establishment issues, not `httpRequestTimeout` for the full request
457-
- Only reduce request timeouts if you have robust retry logic and can handle increased system load
444+
Short timeouts can be problematic for the following reasons:
445+
446+
- Most requests that exceed short timeouts, for example < 1s, still succeed with normal latency.
447+
- Retrying typically doesn't speed up message delivery and creates additional system load.
448+
- During high load or scaling operations, retry storms can worsen performance.
449+
- You'll miss important error notifications (rate limits, channel limits) if requests timeout prematurely.
450+
451+
The default 10-second timeout is designed to:
452+
453+
- Account for channel activation latency in multi-region deployments.
454+
- Handle network and processing queue variations.
455+
- Provide reliable error reporting for legitimate failures.
456+
457+
When to consider timeout adjustments:
458+
459+
- Use `httpOpenTimeout` (default 4s) for connection establishment issues, not `httpRequestTimeout` for the full request.
460+
- Only reduce request timeouts if you have robust retry logic and can handle increased system load.
458461

459462
<Aside data-type="further-reading">
460463
You can find out more detail about how [channels](/docs/channels) and [messages](/docs/messages) work.

0 commit comments

Comments
 (0)