Load Balancer

Explore how traffic is distributed across multiple servers using different algorithms and health check strategies.

Goal: Understand how balancing policy and health checks affect fairness, latency, and failures.Try: Mark one server slow or failed, then turn health checks off and compare the error rate and distribution metrics.

Traffic controls

Change inputs and watch the system react.

Live architecture

Traffic dots move toward the servers receiving load.

Health checks enabled

Clients

260/sec

Load Balancer

routes requests

Server A
87 rps62%
Server B
87 rps50%
Server C
87 rps69%
Avg Latency
107ms
Error Rate
0%
Server Utilization
60%
Requests/sec
260
Availability
100%
Hotspot Risk
19
Dropped Requests
0
Healthy Servers
3

Insight

What changed

Requests are distributed evenly across servers.

Why it matters

This works well when servers have similar capacity.

Tradeoff

It ignores current load, so slow servers may still receive traffic.

Mini challenges

Can the system meet the goal?

Change controls above. Cards solve immediately when the system satisfies the condition.

Keep latency below 120ms

Handle 2x traffic without errors

Survive one server failure

Avoid server hotspot

Pick sticky session strategy

Step 1: Start with Round Robin and observe even distribution.
Step 2: Increase traffic and watch utilization rise.
Step 3: Add another server to reduce latency.
Step 4: Fail one server and compare health checks on/off.
Step 5: Switch to Least Connections for uneven workloads.
Step 6: Use Weighted Round Robin when stronger servers exist.

Summary

  • Load balancers distribute requests so one server does not absorb all traffic.
  • Algorithms change behavior: even routing, load-aware routing, weights, affinity, or randomness.
  • Health checks protect availability by avoiding failed servers.
  • Scaling helps latency, but shared dependencies can still become bottlenecks.

Why this exists

Load balancing exists to spread requests across healthy servers so no single instance becomes the choke point. The algorithm matters less than the guarantees: distribution, health awareness, and graceful failure handling.

Distribution protects the tier

A load balancer turns a server group into one logical endpoint and prevents accidental hot-spotting on a single machine.

Health checks are non-negotiable

Balancing across unhealthy servers is worse than not balancing at all. Real load balancers continuously validate targets.

Algorithm is context-dependent

Round robin is simple. Least connections and latency-aware choices help when request cost varies widely.

Key takeaways

  • Load balancers scale stateless tiers by turning many instances into one entry point.
  • Health checks and failover matter as much as raw distribution.
  • Session affinity can help some workloads, but it reduces flexibility.
  • A load balancer is a control plane for traffic, not just a router.