DC Experiment No 8
DC Experiment No 8
DIV:B Batch:C
ID:vu1f2021100
Distributed Computing
Experiment No. 8
Theory:
Key
The load balancer maintains a list of servers available to handle incoming requests.
Server
Round
The RoundRobin
Robin algorithm systematically selects servers in a circular order for each new
request.
Each server is chosen in turn, and the next request is directed to the next server in the list.
Equal
The Workgoal is to achieve an even distribution of requests among the available servers.
primary
This prevents specific servers from being overloaded while others remain underutilized.
Statelessnes
The algorithm is stateless, meaning it does not consider the current load or historical
performance of servers.
Implementatio
The provided Java program exemplifies the Round Robin Load Balancing Algorithm. The
LoadBalanc class maintains a list of servers and utilizes the round-robin approach to
distribute incoming requests among them.
Name:Suyash Jadhav
DIV:B Batch:C
ID:vu1f2021100
Distributed Computing
Usag
Initializatio
Create an instance of the LoadBalanc class.
Advantage
The Round Robin algorithm is simple to implement and understand.
Simplicit
It does not require complex calculations or monitoring.
Equal
Requests are evenly distributed among servers, preventing overloading of specific nodes.
No algorithm
The Server State
is stateless, which simplifies its implementation and reduces management
overhead.
Consideration
The algorithm lacks intelligence to consider server load, capacity, or
Lack of
performance. It may not be suitable for systems with varying server capabilities.
Dynamic
In dynamic environments, where server loads change frequently, more sophisticated load
balancing algorithms may be more appropriate.
CODE:
import java.util.ArrayList;
import java.util.List;
Name:Suyash Jadhav
DIV:B Batch:C
ID:vu1f2021100
Distributed Computing
class LoadBalancer
{
private List<String> servers;
private int currentIndex;
public LoadBalancer() {
servers = new ArrayList<>();
currentIndex = 0;
}
servers.add(server);
}
return selectedServer;
}
}
OUTPUT:
Conclusion:
The Round Robin Load Balancing Algorithm provides a basic yet effective means of
distributing workloads in a distributed system. Its simplicity makes it suitable for scenarios
where fine-grained control and sophisticated decision-making are not critical, ensuring a fair
distribution of requests among available servers. However, in more complex environments,
other load balancing algorithms may be preferred to address specific considerations.