forked from cloudfoundry/docs-cf-admin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
routing-keepalive.html.md.erb
41 lines (28 loc) · 2.41 KB
/
routing-keepalive.html.md.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
---
title: Router Backend Keepalive Connections
owner: Routing
---
<strong><%= modified_date %></strong>
This topic describes how to enable support in the Gorouter for keepalive connections with backends, and considerations for configuration.
Support for keepalive connections is described in [Idle Keepalive Connections](../concepts/http-routing.html#keepalive).
## <a id="enable"></a>Enable Keepalive Connections from the Gorouter to Backends
By default, support for keepalive connections with backends is disabled. <%= vars.keepalive_router %>
## <a id="max-idle"></a>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. Accommodating for growth of 2x, an operator might configure a maximum of 2000 idle connections per router.
The 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.
## <a id="retry"></a>Gorouter Retry Behavior ##
When you deploy an app that requires Diego cells to restart or recreate, the app may not respond to a Gorouter request before the keepalive connection breaks. The following table describes how the Gorouter behaves if it cannot establish a TCP connection to an app:
<table>
<tr>
<th>If the Gorouter ...</th>
<th>then the Gorouter ...</th>
</tr><tr>
<td>cannot establish a TCP connection to the routing backend for the app</td>
<td>waits 15 minutes for a response.</td>
</tr><tr>
<td>establishes a TCP connection to the routing backend, but the app does not respond</td>
<td>retries the request three times.</td>
</tr>
</table>
In both cases, if the app still does not respond to the request, the Gorouter returns a 502.