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.

Read Timeout

Read Timeout sets the maximum amount of time for the client to receive an entire HTTP request stream.

How to configure

Config file keysEnvironment variablesTypeDefault
timeout_readTIMEOUT_READstring (Go Duration formatting)30s

Examples

timeout_read: 30s
TIMEOUT_READ=30s

Write Timeout

Write Timeout sets the maximum time that a stream’s lifetime will span. An HTTP request/response exchange fully consumes a single stream. So, the write_timeout value must be greater than read_timeout, as it covers both the HTTP request and response time.

How to configure

Config file keysEnvironment variablesTypeDefault
timeout_writeTIMEOUT_WRITEstring (Go Duration formatting)0

Examples

timeout_write: 0
TIMEOUT_WRITE=0

Idle Timeout

Idle Timeout sets the time at which an upstream or downstream connection will be terminated if there are no active streams.

How to configure

Config file keysEnvironment variablesTypeDefault
timeout_idleTIMEOUT_IDLEstring (Go Duration formatting)5m

Examples

timeout_idle: 5m
TIMEOUT_IDLE=5m