Skip to the content.

⚖️ Load Balancing Algorithms

Definition:

Load balancing is the process of distributing incoming network or application traffic across multiple servers to ensure high availability, reliability, and performance.

The algorithm defines how the traffic is distributed.


1️⃣ Common Load Balancing Algorithms

a) Round Robin

Example: 3 servers → requests go to S1 → S2 → S3 → S1 → S2 → S3…


b) Weighted Round Robin


c) Least Connections


d) Least Response Time


e) IP Hash


f) Random


g) Weighted Least Connections


2️⃣ Use Cases

Algorithm Best For
Round Robin Small, similar servers
Weighted Round Robin Mixed server capacities
Least Connections Long-running sessions (DB connections)
Least Response Time Optimize latency & performance
IP Hash Session stickiness / caching
Random Low-complexity or small setups

3️⃣ Analogy