| Algorithm | How It Works | Best For |
|---|---|---|
| 1. Round Robin | Cycles through servers sequentially (1 → 2 → 3 → … → 1). | Simple, equal-capacity servers |
| 2. Least Connections | Routes to the server with the fewest active connections. | Handling uneven traffic or variable request durations |
| 3. Weighted Round Robin | Assigns more requests to higher-capacity servers based on predefined weights. | Heterogeneous server clusters |
| 4. Weighted Least Conn. | Considers both weights and active connections. | High-capacity servers with dynamic load |
| 5. IP Hash | Uses IP address hashing to pick a server. | Session persistence / sticky sessions |
| 6. Least Response Time | Chooses server with lowest response time and fewest active connections. | Performance-sensitive systems |
| 7. Random | Selects a server at random from the pool. | Lightweight, low-complexity load balancing |
| 8. Least Bandwidth | Picks the server using the least network bandwidth currently. | Bandwidth-sensitive applications (e.g., media streaming) |
💡 Takeaway:
-
Use Round Robin or Random for simplicity.
-
Use Least Connections or Least Response Time when performance varies per server.
-
Use IP Hash when sticky sessions are essential.
-
Use Weighted strategies when servers have different capacities.