Which persistence methods are available?
Short answer
The methods vary by vService type. In the Persistence field of an HTTP vService there are None (default), New Cookie, Current Cookie, Hash and Session Affinity Manager (SAM); in an L7 TCP vService, None and Hash; in a Network vService, L4 Persistence and SIP Persistence. In addition, the Source, URI, URL Param and HDR (HTTP) and RDP Cookie (L7 TCP) algorithms provide persistence themselves; when one of them is selected, the Persistence field is hidden. In HTTP, the Cookie Based Connection Persistency action is also used for condition-based persistence.
Methods
| Method | vService type | How it works | Keeps state on TR7 | Settings and defaults |
|---|---|---|---|---|
| None (default) | HTTP, L7 TCP | Persistence is off; each request or connection is distributed independently according to the algorithm | – | – |
| New Cookie | HTTP | TR7 adds its own persistence cookie to the first response; in subsequent requests, the cookie is read and the client is sent to the same Backend Service | No (the information is in the cookie) | Cookie Name (TR-C if empty), Cookie Max-Idle 30 min (60 s – 7 days), Cookie Max-Life 8 h (10 min – 30 days) |
| Current Cookie | HTTP | The application's own cookie (e.g. JSESSIONID) is used; a Backend Service marker is added in front of the value. If the cookie is not in the request, the request is distributed according to the algorithm | No (the information is in the cookie) | Cookie Name (required) |
| Hash | HTTP, L7 TCP | The mapping of a key built from Smart Variables → Backend Service is kept in a table | Yes (device-local) | Hash Key (at least 1 Smart Variable, no duplicates), Hash Key List Size 3,000,000 (10,000 – 100,000,000), Hash Key Expire Time 7 days (10 min – 365 days) |
| Session Affinity Manager (SAM) | HTTP | The session ID is carried in the cookie; the session → Backend Service mapping and the session counters are kept in a table, and sessions can be monitored and rebalanced | Yes (device-local, 1,000,000 records) | Cookie Source TR7 Generates, Cookie Name (required, placeholder TR7SID), Session ID Format UUID, Max Life 24 h, Max Idle 30 min, Security Flags HttpOnly + Secure (HTTPS only) |
| L4 Persistence | Network | Connections coming from the same source IP go to the same Backend Service for the specified duration | Yes (device-local) | The switch is off by default; when it is turned on, the duration comes as 5 min |
| SIP Persistence | Network | In SIP traffic over UDP, it sends the messages of the same call (Call-ID) to the same Backend Service; it works only while L4 persistence is on | Yes (device-local) | Off by default; hidden while Protocol is ANY - L3, not applied while Port range is on; since UDP packets that cannot be parsed as SIP are dropped, it is turned on only on a vService that carries SIP |
Self-Persistent Algorithms
The following algorithms provide persistence themselves because they select the server with the hash of a value. They appear in the selector with the "(Self-persistent)" suffix; when they are selected, the Persistence field is removed from the form and the two methods cannot be used together. In these algorithms, the Hash Consistency field appears (off by default).
| Algorithm | vService type | Source of the hash |
|---|---|---|
| Source | HTTP | The source IP of the client |
| URI | HTTP | URI (with URI Character Length and URI depth) |
| URL Param | HTTP | The value of the specified URL parameter |
| HDR | HTTP | The value of the specified HTTP header |
| RDP Cookie | L7 TCP | The RDP session cookie |
Cookie Based Connection Persistency Action
The Cookie Based Connection Persistency action is used to apply persistence on an HTTP vService only under certain conditions. The action uses the Cookie Content value of the Backend Services. The docs recommend that this action not be used together with the New Cookie or Current Cookie setting of the vService.
In TR7
- Location: Load Balancer → Load Balancer vService List → vService → Edit → Details → LB Algorithm box → Persistence; it is saved with Save. If the box is turned off, the algorithm returns to the default and Persistence is cleared.
- Network: L4 Persistence and SIP Persistence are in the same box, below the algorithm selector.
- WEB-CLI: The
--persistencefield takes the valuetr7Cookie(New Cookie),serverCookie(Current Cookie),dynamicPersistence(Hash) orsam(WEB-CLI · lb service · Server Persistence). - Cluster: Persistence settings are transferred to the peer device automatically while Clustering is on and Manual Sync Mode is off (default). The Hash, SAM, L4 and SIP persistence tables, however, are kept separately on each device and are not shared between devices; in cookie-based methods, since the information is in the cookie, both devices give the same result.
Common Misconceptions
- "L7 TCP has cookie persistence." L7 TCP has only None and Hash; New Cookie, Current Cookie and SAM are only in HTTP.
- "The Hash or SAM table is shared in the cluster." These tables are device-local.
- "The Persistence field has disappeared." A self-persistent algorithm is selected, or the LB algorithm box is off.
- "SIP persistence is enough on its own." SIP persistence works only while L4 persistence is on.
How it is done in the documentation
