What is a Health Check?
A health check, told as a story about asking every ride 'are you okay?' every few seconds.
The ride is stalled, but the sign still says 'running.'Guests wait in line only to find out it's not running.
From a distance it looks fine, but inside it may have already stopped.Looking at the screen alone can't tell you what's inside.
Every few seconds, ask each ride 'click — are you okay?' — no answer, and it's pulled from the list.Get well again, and it comes back on the list on its own.
Two different questions — are you alive? are you ready for guests?A ride can be alive but still not ready yet.
Checking too often becomes its own burden.You need to find the right interval.
A health check = asking every ride 'are you okay?' every few seconds, and pulling it from the list when there's no answer — then letting it back in once it's well again.
A method of pinging a service at regular intervals to see if it's still alive. Whether it's alive (liveness) and whether it's ready for traffic (readiness) are two different questions, and the result feeds straight into a load balancer, updating the list of who's in service.
When grown-ups say it
- Health check
- Asking 'are you okay?' every few seconds. No answer means it's pulled from the list.
- Liveness
- The question 'are you alive at all?' Passing this alone doesn't mean everything's fine.
- Readiness
- The question 'are you ready for guests?' A ride can be alive but still not ready yet.
- Ping / Heartbeat
- The short click-signal sent out. The reply to this signal is what tells you the status.
- Automatic removal and return
- Dropping out on no answer, and returning once well again. No one has to manage this by hand.
- Load balancer integration
- Where the health-check result goes next. It only sends guests to rides that passed. → the usher who spreads guests across booths
- Failover
- Switching to another ride instead of one that's not answering. A failover can only start once the health check has already noticed.
- Service discovery
- The sign that shows which rides are currently open. Health-check results are what keep this sign always up to date.