Liveness versus readiness
Liveness answers “is the process alive?” If this fails, the container should be restarted. Readiness answers “can it handle requests?” If this fails, stop sending traffic but do not restart. Example: your app is running but the database is down. Liveness passes because the process is alive; readiness fails because it cannot serve requests. The load balancer stops routing to this instance while it recovers.Response format
200 OK when healthy and 503 Service Unavailable when not.
Wiring it up
- Load balancer
- Kubernetes
- Docker
For AWS ALB, GCP and similar:
Apps scaffolded before 0.9.7 also have a
routes/api/health.py giving /api/health.
That route is yours, not the framework’s, and it only proves the process is listening.
Point new health checks at /health.