A health check is an automated periodic probe sent to a service or endpoint to determine whether it is healthy, unhealthy, or degraded. Load balancers, DNS failover systems, and container orchestrators use health checks to route traffic only to working instances and to trigger failover or recovery actions when services become unavailable.
Common health check mechanisms include:
- TCP check: Attempts a TCP handshake to a specific host and port. Success indicates the service is listening; no application-layer validation is performed.
- ICMP check: Sends a standard ping (Echo Request/Reply per RFC 792) to test basic network connectivity.
- HTTP(S) check: Sends a GET or HEAD request to a specific path (such as
/healthor/status) and validates the HTTP response code (typically 200) and optional response body content. - Custom protocol check: Application-specific probes that verify service logic or data availability.
Health checks run at fixed intervals (often every 5–30 seconds). After a configured number of consecutive failures or successes, the system marks an instance as unhealthy or healthy. If a load balancer detects an unhealthy backend, it stops sending new requests to that instance until it recovers.
TipDefine meaningful health check endpoints that reflect actual service readiness—not just that the process is running. A service may return HTTP 200 but be unable to access its database, for example.
Health checks are essential for maintaining uptime and reducing MTTR by automating detection and isolation of failures.