What is the "Ring Hash" Load-Balancing Algorithm?
What is the "Ring Hash" load-balancing algorithm... and how does Distributed Cloud HTTP Load-Balancing use it?
F5 Distributed Cloud (XC) condenses some features that are managed in different places in the more familiar world of BIG-IP, and a question that comes up is what are the XC LB algorithms and how is persistence configured?
If you look at the algorithms in the Console or API, you'll see a readout like this:
Several times "Consistent Hashing Algorithm" is referenced. Like "Least Sessions" or "Round Robin," Consistent Hashing Algorithm is its own algorithm, but it also includes by definition a persistence method. It essentially *is* the persistence method, which I will explain: Imagine clients and servers on a ring, with server (origin) nodes evenly distributed between clients in the hash table. What is the hash table? It attaches clients to servers in the ring based on hashing some criteria in the request. This can include source IP, cookie, or in the case of the custom Ring Hash Policy, you could define application-specific headers that might include some kind of session ID. The purpose of this kind of algorithm is to provide necessary persistence while tolerating dynamic addition or subtraction of nodes with the minimum amount of remapping between clients and nodes. This is especially important for load-balancing very dynamic microservice sets that might be hosted as pods in kubernetes, but it is equally useful for more traditional workloads so long as you select the proper hash criteria. Selecting a source IP where the client diversity is low will almost certainly result in uneven load-balancing, for instance. See this article for more information about the algorithm.
In summary, Consistent Hashing Algorithm tolerates dynamic changes in pool membership with the least amount of connection re-mapping for a more consistent session map. Since it uses the hash to map the client to its server, it is inherently persistent, all in one go.
See https://docs.cloud.f5.com/docs/how-to/app-networking/http-load-balancer for configuration guidance.