Round Robin, Least Connections, IP Hash

1 min read

Authors
banner

Load Balancing Methods Explained

Round Robin Detailed

Request distribution: S1 → S2 → S3 → S1 → ...

  • Simple and fair
  • Default behavior
  • Good for stateless apps

Use when: All servers are equal

Least Connections Detailed

Always sends to server with fewest connections:

  • Ideal for long connections
  • Adapts to unequal server capacity
  • Better than round-robin for WebSockets

Use when: Connection duration varies

IP Hash Detailed

Same IP → Same server always

  • Sticky sessions
  • No session storage needed
  • Problem: Server down = session loss

Use when: Sessions must stick to server

Comparison Table

MethodSession StickyFair DistributionLong Connections
Round RobinNoYesNo
Least ConnNoYesYes
IP HashYesNoSo-so

Choose wisely!

© 2025 Vijay Rajendran