Types of server affinity | Cross-port affinity


Load Balancer Stickyness to source IP address


This affinity feature is enabled by configuring the clustered port to be sticky, which allows subsequent client requests to be directed to the same server.

This is done by setting the sticky time to a positive number. The feature can be disabled by setting the sticky time to zero.

The sticky time value represents the timeout of the affinity counter. The affinity counter is reset every time Load Balancer receives a client request. If this counter exceeds sticky time, new connections from this client may be forwarded to a different back-end server.

In Dispatcher and CBR components, you can set the sticky time in three elements of the Load Balancer configuration:

Executor Setting the sticky time for the executor makes this value valid for all clusters and ports in the configuration.
Cluster You can set a specific sticky time value for each cluster.
Port You can set a specific sticky time value for each port.

Setting affinity at the different levels means that any subsequent lower-level objects inherit this setting by default (when they are added). In fact, the only true value that is used for sticky time is what is set at the port level. So, if you set the sticky time for the executor to 60, then add a cluster and port, these also have a sticky time of 60.

However, if you set a different sticky time for the cluster or the port, for example, you set it to 30, then this value overrides the Executor sticky time.

This feature applies to all forwarding methods.

This affinity strategy has some drawbacks. Some ISPs use proxies that collapse many client connections into a small number of source IP addresses. A large number of users who are not part of the session will be connected to the same server. Other proxies use a pool of user IP addresses chosen at random, even for connections from the same user, invalidating the affinity.