Router Idle Keepalive Connections
Page last updated:
This topic describes how to enable support for idle keepalive connections in the CF router, and considerations for configuration.
Support for keepalive connections is described in Idle Keepalive Connections.
Enabling Idle Keepalive Connections for Gorouter to Backends
By default, support for keepalive connections is disabled. An operator can enable the feature by configuring a non-zero value for the manifest property
Considerations for Configuring Max Idle Keepalive Connections
Each router process is limited to 100,000 file descriptors. Each inbound request consumes at most two file descriptors; one for the connection from the client and one from the Gorouter to the backend. For this reason we recommend that Max Idle Connections is never set higher than 50,000. As a few other file descriptors are consumed by the process under normal operation, this limit is more like 49,900.
In order to determine how many idle connections are needed, consider that the peak connections could be calculated by multiplying throughput by response time. Example: if a single router receives 1000 requests per second, and response time is 1 second, at any given time there are likely to be 1000 connections open to backends. Accomodating for growth of 2x, an operator might configure a maximum of 2000 idle connections per router.
Gorouter has been hard coded with a limit of 100 idle connections per backend. The configurable property
max_idle_connections governs idle connections across all backends.