Quiz: Load Balancing¶
2 questions
L2 (2 questions)¶
1. What is the difference between L4 and L7 load balancing?
Show answer
L4 routes by IP/port (fast, protocol-agnostic, no payload inspection). L7 routes by HTTP headers, path, cookies (smarter routing, can do TLS termination, caching). L7 adds latency but enables content-based routing.2. Some backends are slow but the load balancer keeps sending them traffic. Why?
Show answer
Default round-robin doesn't consider backend health or latency. Fix:1. Enable active health checks so unhealthy backends are removed.
2. Use least-connections algorithm.
3. Set request timeouts so slow backends don't hold connections.
4. Check if keep-alive is pinning connections.