Skip to main content

Global Timeouts

Global Timeouts set the global server timeouts for HTTP request and response streams.

You can set also set route-level timeouts.

Timeout Flow Overview

The following diagram shows how different timeouts apply throughout the request lifecycle:

Backend (Upstream)PomeriumClientBackend (Upstream)PomeriumClientRead Timeout starts when request beginsDefault Upstream Timeout startsafter full request is receivedWrite Timeout coversentire request+response streamIdle Timeout closes idle connectionswith no active requestsHTTP Request (from client)Forward request to upstream(once request is fully received)Upstream ResponseHTTP Response (to client)

Timeout Settings Overview

TimeoutDirectionDefaultPurpose
Read TimeoutDownstream30sTime allowed to receive complete request from client
Write TimeoutDownstream0 (disabled)Total time for entire request/response cycle
Idle TimeoutBidirectional5mCloses inactive connections when idle
Default Upstream TimeoutUpstream30sTime allowed for backend to respond

Read Timeout

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.

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.)

How to configure

Config file keysEnvironment variablesTypeDefault
timeout_readTIMEOUT_READGo Duration string30s

Examples

timeout_read: 30s
TIMEOUT_READ=30s

Write Timeout

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 setting as it encompasses the entire request/response lifecycle.

Setting this timeout to 0 disables it, meaning there is no time limit for request/response completion.

How to configure

Config file keysEnvironment variablesTypeDefault
timeout_writeTIMEOUT_WRITEGo Duration string0 (no timeout)

Examples

timeout_write: 0
TIMEOUT_WRITE=0

Idle Timeout

Idle Timeout sets the duration after which an upstream or downstream connection will be terminated if there are no active requests or responses.

Setting this timeout to 0 disables it, allowing connections to remain open indefinitely when idle.

How to configure

Config file keysEnvironment variablesTypeDefault
timeout_idleTIMEOUT_IDLEGo Duration string5m

Examples

timeout_idle: 5m
TIMEOUT_IDLE=5m

Default Upstream Timeout

Default Upstream Timeout is the default timeout applied to a proxied route when no timeout key is specified by the policy.

How to configure

Config file keysEnvironment variablesTypeDefault
default_upstream_timeoutDEFAULT_UPSTREAM_TIMEOUTGo Duration string30s

Examples

default_upstream_timeout: 30s
DEFAULT_UPSTREAM_TIMEOUT=1h45m
Feedback