2.4. Load Balancing
A load balancer decides which instance serves each request, and that decision determines your tail latency, your blast radius during a partial outage, and whether a single hot backend can take down the fleet. The mechanics differ sharply by layer: an L4 balancer moves packets without understanding them, while an L7 balancer reads the request and can route on content — at higher cost. This chapter covers the algorithms, the connection-versus-request distinction that HTTP/2 makes critical, and health-aware routing that pulls failing nodes before users notice.
Topics Covered
Section titled “Topics Covered”- 2.4.1. L4 vs. L7 Load Balancing: Transport vs. Application Layer: Contrasts transport-layer balancing that moves packets with application-layer balancing that routes on content.
- 2.4.2. Algorithms: Round Robin, Least Connections, Weighted, Consistent Hashing: Covers round robin, least connections, weighted, and consistent hashing, and when each distributes load best.
- 2.4.3. Client-Side vs. Server-Side Load Balancing: Compares putting the balancing decision in the client against hiding it behind a dedicated load balancer.
- 2.4.4. Global Server Load Balancing (GSLB) and Anycast: Explains global load balancing and Anycast routing that steer users to the nearest healthy region.
- 2.4.5. Health-Aware Routing and Connection Draining: Covers health checks, outlier detection, and connection draining that remove failing nodes before users notice.