What is HTTP TCP Multiplexing; how does it reduce the number of backend connections?
Short answer
HTTP TCP Multiplexing is the action that manages keeping the connections between TR7 and the Backend Service open after the request and also using them for the requests of other client sessions. Since an idle connection is used instead of opening a new connection, and in HTTPS a new TLS handshake, for each request, the number of connections on the Backend Service and the connection setup load decrease. Whether the connection stays open is determined with Connection Mode, and the sharing level with Connection Share Strategy; the action is used only in an HTTP vService, once per vService. If the action is not added at all, the connections are kept open and Safe sharing is applied.
How Does It Work?
TR7 forwards the requests coming from the client to the Backend Service over the connections it opens itself. If these connections are kept open after the response, subsequent requests use the same connection without opening a new one; when sharing is allowed, a request of another client can also use a connection whose opening was caused by one client.
Connection Mode
| Option | Behavior |
|---|---|
| Keep the connection open (default) | The Backend Service connection stays open; sharing is done only in this mode |
| Close the backend service connection (not recommended) | The client connection stays open, the Backend Service connection is closed after each response |
| Close after Every Request (not recommended) | After each request, the connections on both sides are closed; HTTP Keepalive Timeout in the Timeouts profile becomes ineffective |
Connection Share Strategy
| Option | Sharing |
|---|---|
| Never | Connections are not shared among sessions |
| Safe | The first request of a session opens a new connection; subsequent requests can use the existing connections |
| Aggresive | The first request is sent only to connections that have been successfully reused before |
| Always | The existing connections can be used on every request |
If the field is left empty, the Safe behavior applies (Connection Share Strategy). The field is visible only while Keep the connection open is selected.
HTTP TCP Multiplexing in TR7
- Where: The action is created with Load Balancer → Actions → Add by selecting Action Type = HTTP TCP Multiplexing, it is added to the Details → Actions field of the vService, and Save is clicked; it does not take a condition.
- Effect of the change: The save is applied without dropping open connections. In a cluster, it is also sent to the peer device with the default auto-sync; if Manual Sync Mode is on, it is sent with Synchronize.
- Limits in the closing modes: In the Close modes, each request opens a new connection, and in HTTPS a new TLS handshake; the per-second connection and SSL limits in the vService Limits profile are monitored (What is the vService Limits profile; what are the default limits?).
- Limit: If a second HTTP TCP Multiplexing action is added, the vService form gives the "Max. number for HTTP TCP multiplexing rule is exceeded" warning.
- Monitoring: Its effect is seen on the vService dashboard on the Backend Connections Distribution graph, as a drop in the number of new connections.
Common Misconceptions
- "It also reduces client connections." It affects only the connections between TR7 and the Backend Service.
- "Always is safe in every application." In applications that use connection-bound authentication such as NTLM or Kerberos (Exchange, SharePoint, IIS), Never or Safe is preferred.
- "The modes that close the connection are safer." Since a new connection and a TLS handshake are opened on every request, the load increases; they are used only for services that have problems with persistent connections.
- "It is the same thing as HTTP/2." HTTP/2 is the protocol between the client and TR7; this action manages the Backend Service side.
How it is done in the documentation
Related questions
- What do the values in the Timeouts profile (HTTP Keepalive Timeout, HTTP Request Timeout, Connect, Server, Client, Queue, Tunnel(Websocket) Timeout, Client FIN, Server FIN) mean?
- What is the vService Limits profile; what are the default limits?
- Which features does TR7 offer to speed up my application?
