Static LOAD BALANCING
Table of contents
Introduction
Types of Load balancing
Static load balancing
Dynamic load balancing
Welcome to my first blog! I will be posting concise topic explanations that you can read and gain knowledge from.
We know the importance of load balancing in distributed systems and how they are shaping modern system design architectures, but let's explore the types of load balancers, and I will explain them to you quickly and easily!
Static load balancing spreads tasks using fixed rules, not considering the system's current condition. On the other hand, dynamic load balancing changes the task distribution in real-time based on how the system is performing and the current load.
Static Load Balancing
Round Robin
Sticky Round Robin
Hash functions
Weighted Round Robin
Round Robin
One of the classic techniques , Round Robin is one of the ways of load balancing wherein the incoming requests are routed in a sort of circular fashion . Example , if there are 3 servers :- A , B , C , and there are requests r1 , r2 , r3 , r4 , r5 , r6.
a gets r1
b gets r2
c gets r3
a gets r4
b gets r5
c gets r6
Noticed a pattern here ? …
Weighted Round Robin
Each computational resource is assigned a weight manually, which means a server with more weight can handle more incoming client requests, implying that servers with less weight receive fewer requests. Hence, the servers here are heterogeneous.
Round Robin is suitable for systems with equally capable servers and uniform request sizes, while Weighted Round Robin is beneficial when servers have different processing capabilities.
Sticky Round Robin
As the name suggests, in sticky round robin, a particular user's requests will be routed to one specific computational resource (hence the name sticky, as the routing seems to always send the same user's requests to the same server). For example, user A's requests always get routed to server 1, and user B's requests are routed to server 2.
The disadvantage is that this can lead to an uneven load; for example, if a new user arrives with just one request, and that server is under utilised by handling only one request. However, Sticky Round Robin ensures session persistence.
Hash Function
The load balancer takes the IP of the client and request URL and inputs it to the hash-function , the output of which determines which server the request to be routed towards.
THAT’S ALL FOLKS :)