Unit 4.2 Load Balancing Algorithm
Unit 4.2 Load Balancing Algorithm
Algorithms for load balancing are strategies for effectively allocating workloads among several
servers or resources.
Consider that you have a group of employees and numerous jobs to finish. To keep everyone
active and complete the work efficiently, you should split the tasks evenly rather than assigning
one person to perform all the work while others sit around doing nothing.
In computing, load balancing accomplishes exactly that.
Load balancing algorithms can be broadly categorized into two types:
1. Dynamic load balancing
2. Static load balancing.
3. Resource-based Load
Balancing Algorithm
Static Load Balancing Algorithms
Static load balancing involves predetermined assignment of tasks or resources without
considering real-time variations in the system. This approach relies on a fixed allocation of
workloads to servers or resources, and it doesn’t adapt to changes during runtime.
Types of Static Load Balancing Algorithms are:
The Weighted Round Robin algorithm is also a static load balancing approach which is much
similar to the round-robin technique. The only difference is, that each of the resources in a list is
provided a weighted score. Depending on the weighted score the request is distributed to these
servers.
● Servers with higher weights are given a larger proportion of the requests.
● The distribution is cyclic, similar to the round-robin technique, but with each server
receiving a number of requests proportional to its weight.
● If a server reaches its processing capacity, it may start rejecting or queuing additional
requests, depending on the server's specific behavior.
For example
Let's say you have three servers with weights: Server1 (weight 0.3), Server2 (weight 0.2),
and Server3 (weight 0.1). The total weight is 0.3 + 0.2 + 0.1 = 0.6. During each cycle,
Server1 would receive 0.3/0.6 (50%) of the requests, Server2 would receive 0.2/0.6
(33.33%), and Server3 would receive 0.1/0.6 (16.67%).
3. Source IP Hash Load Balancing Algorithm
This algorithm aims to ensure that requests originating from the same source IP address are
consistently directed to the same server.
The idea is to distribute incoming workloads in a way that minimizes the current load on
each server, aiming for a balanced distribution of connections across all available resources.
The Least Response method aims to minimize response times by directing new requests to the
server with the quickest response time.
The Resource-Based Load Balancing algorithm distributes incoming requests based on the
current resource availability of each server, such as CPU usage, memory, or network bandwidth.
Rather than just routing traffic equally or based on past performance, this algorithm evaluates
the current "resource health" of each server to decide where new requests should go.