Load Balancer Simulator

Watch requests distribute across servers in real time

Distribution Algorithms

Round Robin

Requests are distributed sequentially across servers. Simple and effective when servers have equal capacity and request cost is uniform. Doesn't account for server load or request duration.

Complexity: O(1)Best for: homogeneous requestsUsed by: nginx default

Health Check Simulation

How Health Checks Work

The load balancer sends periodic HTTP requests (or TCP pings) to each server. If a server fails N consecutive checks, it's removed from rotation. Traffic is automatically redistributed to healthy servers.

Check interval: 5sFailure threshold: 3 failsRecovery: 2 passesProtocol: HTTP GET /health

Session Persistence (Sticky Sessions)

When Do You Need Sticky Sessions?

Without sticky sessions, each request may go to a different server — meaning session data (shopping cart, login state) stored in-memory would be lost. Solutions: sticky sessions (same server), or shared session store (Redis).

Problem: stateful appsCookie-based: JSESSIONIDBetter: shared Redis session

Geographic Load Balancing

GeoDNS & Anycast

GeoDNS returns different IP addresses based on the user's location. Anycast uses BGP routing — multiple servers share the same IP, and internet routing protocols direct users to the nearest one automatically.

Latency: 20-50ms local vs 200ms+ globalGeoDNS: AWS Route53, CloudflareAnycast: Cloudflare, Akamai