Interview Prep/Networking/Load Balancing, Proxies & CDN

How do health checks work on a load balancer and what makes a good one?

BeginnerScenarioLoad Balancing, Proxies & CDN
Answer

Situation read → A health check decides which targets receive traffic.

What I'd do →

  1. The LB probes each target periodically, for example HTTP GET /healthz every 10 seconds
  2. A target is marked unhealthy after N consecutive failures and healthy after M successes
  3. Keep the endpoint cheap and check only what this instance needs (can it serve?), not every downstream
  4. Configure in AWS with aws elbv2 modify-target-group --health-check-path /healthz --healthy-threshold-count 2
  5. Return 200 only after the app is warmed up

Why → Deep health checks that fail when the database is down can take the entire fleet out at once.

Interview tip → Say you separate liveness from readiness in Kubernetes for the same reason.

All Networking questions Roadmap: Networking for DevOps

More on Load Balancing, Proxies & CDN