Round Robin Load Balancing

Description

Round Robin Load Balancing is one of the simplest and most commonly used load balancing techniques. It distributes incoming requests to a list of instances in a circular order. This ensures that each instance receives an equal number of requests over time, balancing the load across all instances.

Round Robin Load Balancing is most commonly used because of its simplicity. Its implementation is rather straightforward. It is a distributor that redirects the traffic from different users to the servers in order. Let’s see an example. Imagine we have 6 users (u1, u2, u3, u4, u5 and u6) who want to connect and you have 3 servers (s1, s2 and s3). U1 will connect to s1, u2 to s2, u3 to s3 and it will start all over again u4 to s1, u5 to s2 and u6 to s3. The next user 7, it will connect to s1.

It takes into account just when somebody wants to connect. Nothing more. It will definitely serve as a load balance, based on this logic, but ignore all other parameters. So we will have reduced load on the network, but we can have different problems.

Load Balancing GIF

Key Features

Use Case

Round Robin Load Balancing is ideal for scenarios where all instances have similar processing capabilities and the load is evenly distributed. It is commonly used in web servers, where requests are distributed among multiple servers to balance the load.

Implementation

Here is the Java implementation of the Round Robin Load Balancing algorithm. This implementation reads metrics from a CSV file and distributes incoming requests to instances in a round-robin manner.

Click here to view the code for the Round Robin Load Balancing module