http2_idle_timeout

Sets the duration during which an idle HTTP/2 connection remains open.

Syntaxhttp2_idle_timeout time;
Defaultnone
Contexthttp, server
Arguments1

Description

The http2_idle_timeout directive specifies the maximum time that an HTTP/2 connection can remain idle before it is closed by the server. This timeout is particularly useful in scenarios where clients might hold connections open unnecessarily, consuming server resources without any data transfer. By setting an appropriate idle timeout, server admins can free up resources and improve performance for other clients.

This directive accepts a single argument which is a time value in seconds, with optional suffixes such as 'm' for minutes and 'h' for hours. For instance, specifying http2_idle_timeout 10s; sets the idle timeout to 10 seconds. If a client does not send any requests within the specified time frame, the server will close the connection, potentially leading to a more efficient use of resources and better overall server performance. It's important to select a balance for this value that accommodates the expected usage patterns of clients, as overly strict limits might disconnect clients too aggressively.

Config Example

http2_idle_timeout 5s;

Setting a very low timeout can lead to premature disconnections, especially for clients that keep connections open for longer periods without sending requests.

Ensure that the timeout is compatible with client-side settings or expected usage patterns to avoid frustrating users.

← Back to all directives