What is Round Robin?

Round robin is a system model with a number of request servicers, where each request is routed to the next servicer in the lineup.  A diagram of how a round robin system works is below:

A round robin system has n servicers

For the purposes of our example we will number the n servicers from 1 to n.  In our example, there are six servicers, so the servicers are numbered 1, 2, 3, 4, 5, 6.

A round robin system routes requests to the next servicer

Suppose for our example the system has initialized and a request comes in.  The round robin system routes that request to servicer 1.  The next request that comes in to the round robin system gets routed to servicer 2.  And so on until we reach servicer 6.  Then the round robin system returns to servicer 1 for the next request.

Round robin system issues and opportunities

To be robust, a practical round robin system needs to be able to deal with the failure of a servicer.  If a servicer cannot process a request for any reason, the round robin system needs to skip that servicer when assigning requests.

To maximize throughput, the round robin system needs to operate asynchronously.  That is, the round robin system needs to be able to assign a request to a servicer quickly, then move on to the next request.  It cannot afford to wait for the servicer to finish processing the request before moving on to assigning the next request.  Otherwise there could be a bottleneck in the system.

Also, to maximize throughput, a round robin system should check if the servicer is already busy processing a request before assigning a request to the servicer.  For example servicer 2 might still be busy processing a request from the previous round, while servicer 3 is idle.  If the round robin system stalls on servicer 2 or assigns another task to servicer 2 while it is still busy but other servicers are idle, the system will not perform as fast or efficiently as it could.

Where are round robin systems used?

A common use of round robin systems is in the servicing of web page requests.  The Web server might maintain several processes to service web page requests, and route each incoming request to the next process in the line.  Therefore multiple processes can be servicing multiple requests at a time.  If all the servicing processes are busy processing web page requests, the system can either put the page requests into the request queue, or add more servicers (processes) to the system.  However, the server is usually limited by RAM and processor time availability so simply adding more processes (servicers) is not always practicable.

Round robin system example diagram courtesy of OzScience.com

If you have any questions or comments, please post a comment below or visit the forums.

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <blockquote> <p> <b> <i>
  • You may quote other posts using [quote] tags.
  • Filtered words will be replaced with the filtered version of the word.
CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image.