What is a Health Check
A health check is a periodic probe sent to a server to determine whether it is healthy and able to handle traffic. Load balancers, container orchestrators (Kubernetes), and monitoring systems all use health checks.
How it works
Active health checks — the load balancer sends a request (e.g., GET /health) to each server at a regular interval (e.g., every 10 seconds). If the server responds with a success status, it is considered healthy. If it fails a configured number of consecutive checks (e.g., 3), it is removed from the pool.
Passive health checks — the load balancer monitors real traffic. If a server returns too many errors or times out on actual requests, it is marked unhealthy.
A good health endpoint checks real dependencies: can the server reach the database? Is the disk not full? Is the application ready to serve requests? An endpoint that always returns 200 OK regardless of actual state is worse than no health check — it gives false confidence.
Why it matters
Without health checks, a load balancer sends traffic to crashed or misbehaving servers, resulting in errors for users. Health checks enable automatic failover — traffic is routed away from unhealthy servers and restored when they recover.
In Kubernetes, liveness probes restart unhealthy containers and readiness probes control whether a pod receives traffic. Both are forms of health checks.
For the full explanation, see How Load Balancing Works.