The round-robin algorithm

The round-robin algorithm is certainly the most known of all the strategies. It considers the list of available members of the cluster (the servers) as a ring and continuously iterates over this ring each time a request comes.

For instance, if you have three servers (server1.company.com, server2.company.com, server3.company.com), here is how the first requests will be served:

Request number
Selected server
1
server1.company.com
2
server2.company.com
3
server3.company.com
4
server1.company.com
5
server2.company.com
6
server3.company.com
7
server1.company.com
...
...

You will note that to have a fair distribution, the load-balancer strategy must lock or synchronize ...

Get Java EE 8 High Performance now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.