In plain words
A load balancer sits in front of several copies of your app and passes each request to a healthy one, so traffic is shared and one failing server doesn't take the site down.
Where you see it
Harbor's API runs as six containers behind an AWS Application Load Balancer. Every few seconds it calls /healthz on each one, and when a container stops answering, the balancer stops sending it traffic until it recovers.
What goes wrong
- Health checks that test the whole world
If every instance's check queries the shared database, one database blip fails them all at once and the balancer has no healthy instance left to choose. Check what belongs to the instance, and watch shared dependencies separately.
- Deploys that cut requests off mid-flight
Killing an instance while it's still in rotation drops whatever it was serving. Fail the health check, wait for the balancer to drain it, then shut down.
- Taking turns with uneven work
Round robin sends the next request to the next server even if it's busy with three slow exports. A least-connections or least-outstanding-requests setting, which most balancers offer, sends new work to the least busy instance.
What to tell your agent
Quick check
Sign in to earn +10 XP for itHarbor's database has a 20-second hiccup, and the load balancer marks every API instance unhealthy at once. What caused that?