The round-robin algorithm is often used as a simple-yet-effective method of distributing requests to a single-point-of-entry to multiple servers in the background. It’s used by DNS servers, peer-to-peer networks, and many other multiple-node clusters/networks.
In a nutshell, round-robin algorithms pair an incoming request to a specific machine by cycling (or, more specifically, circling) through a list of servers capable of handling the request. It’s a common solution to many network load balancing needs, even though it does not result in a perfectly-balanced load distribution, strictly speaking. In the non-ideal world we our servers live in, there are many reasons why the stock round-robin algorithm just isn’t good enough when it comes to properly balancing server loads.
The first and most important thing to keep in mind is that not all servers are created equal. One should be able to take advantage of all available resources, and it’s impossible to guarantee that all the servers available to process incoming requests are capable of dealing with the same load quantities, take as long to carry out each command, and deal with larger/longer queues as elegantly. Nor can all requests be treated the same, either. Some take longer to process than others, involve more work, and are generally more-demanding than the rest – just as others are finished relatively fast and with far-fewer resources.
Continue reading →