Skip to content

Commit 0d14f40

Browse files
committed
docs: enhance global timeouts documentation with visual diagram and overview table
- Add mermaid sequence diagram showing timeout flow throughout request lifecycle - Add clean 4-column overview table (Timeout/Direction/Default/Purpose) - Clarify timeout behaviors and their relationships - Fix participant naming and text overflow in diagram for proper rendering Fixes #1638
1 parent 463ea8f commit 0d14f40

File tree

2 files changed

+37
-6
lines changed

2 files changed

+37
-6
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,6 @@ yarn-debug.log*
2525
yarn-error.log*
2626

2727
package-lock.json
28+
29+
# Claude guidance file (keep local only)
30+
CLAUDE.md

content/docs/reference/global-timeouts.mdx

Lines changed: 34 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,39 @@ import TabItem from '@theme/TabItem';
2323

2424
You can set also set [route-level timeouts](/docs/reference/routes/timeouts).
2525

26+
## Timeout Flow Overview
27+
28+
The following diagram shows how different timeouts apply throughout the request lifecycle:
29+
30+
```mermaid
31+
sequenceDiagram
32+
participant Client
33+
participant Pomerium
34+
participant Backend (Upstream)
35+
Client->>Pomerium: HTTP Request (from client)
36+
Note over Client,Pomerium: Read Timeout starts when request begins
37+
Pomerium->>Backend (Upstream): Forward request to upstream<br/>(once request is fully received)
38+
Note over Pomerium,Backend (Upstream): Default Upstream Timeout starts<br/>after full request is received
39+
Backend (Upstream)-->>Pomerium: Upstream Response
40+
Pomerium-->>Client: HTTP Response (to client)
41+
Note over Pomerium,Client: Write Timeout covers<br/>entire request+response stream
42+
Note right of Pomerium: Idle Timeout closes idle connections<br/>with no active requests
43+
```
44+
45+
## Timeout Settings Overview
46+
47+
| **Timeout** | **Direction** | **Default** | **Purpose** |
48+
| --- | --- | --- | --- |
49+
| **Read Timeout** | Downstream | 30s | Time allowed to receive complete request from client |
50+
| **Write Timeout** | Downstream | 0 (disabled) | Total time for entire request/response cycle |
51+
| **Idle Timeout** | Bidirectional | 5m | Closes inactive connections when idle |
52+
| **Default Upstream Timeout** | Upstream | 30s | Time allowed for backend to respond |
53+
2654
## Read Timeout
2755

28-
**Read Timeout** sets the maximum amount of time for a downstream client to complete a single HTTP request. The time starts when a request is begun and ends either when Pomerium has proxied the entire request body to the upstream service, or when Pomerium has begun sending a response back to the client.
56+
**Read Timeout** sets the maximum duration allowed for the entire downstream HTTP request to be received. This timeout starts when the downstream client initiates the request and ends when Pomerium has fully received the complete request (including headers and body) from the client.
2957

30-
This timeout is disabled if set to `0`. (This is not recommended, as a malicious client could consume significant resources by beginning many incomplete requests.)
58+
Setting this timeout to `0` disables it. (This is not recommended, as it could allow malicious clients to consume resources with slow or incomplete requests.)
3159

3260
### How to configure
3361

@@ -72,9 +100,9 @@ timeouts:
72100
73101
## Write Timeout
74102
75-
**Write Timeout** sets the maximum time for a single HTTP request/response pair to fully complete. This should be greater than the [**Read Timeout**](#read-timeout) setting as this includes both the request and response time.
103+
**Write Timeout** sets the maximum duration allowed for an entire HTTP request/response cycle to complete. This includes both the time to receive the request from the downstream client and the time to send the complete response back. This timeout should be greater than the [**Read Timeout**](#read-timeout) setting as it encompasses the entire request/response lifecycle.
76104
77-
This timeout is disabled if set to `0`.
105+
Setting this timeout to `0` disables it, meaning there is no time limit for request/response completion.
78106

79107
### How to configure
80108

@@ -119,9 +147,9 @@ timeouts:
119147

120148
## Idle Timeout
121149

122-
**Idle Timeout** sets the time at which an upstream or downstream connection will be terminated if there are no active requests/responses.
150+
**Idle Timeout** sets the duration after which an upstream or downstream connection will be terminated if there are no active requests or responses.
123151

124-
This timeout is disabled if set to `0`.
152+
Setting this timeout to `0` disables it, allowing connections to remain open indefinitely when idle.
125153

126154
### How to configure
127155

0 commit comments

Comments
 (0)