# Health Check

> A small test that asks an app if it is well. Broken copies then get no traffic.

**Field:** Infrastructure  
**Category:** Reliability  
**Also known as:** Health Check Endpoint, Liveness Probe, Readiness Probe

## Think of it like

It is like the teacher calling names. If you do not answer, you are marked as away.

## Definition

A health check is a small test that asks a running app if it is well. Often it is a web address, like /health, that answers OK when things work. A load balancer or orchestrator calls it every few seconds. If the answer is bad, traffic stops going there, or the app is restarted. Some checks ask if the app is alive, and others ask if it is ready for traffic.

## Example

Emma's app answers /health with 200 when its database is reachable. When the database link drops, the check fails and the load balancer skips that copy.

## Example code

```console
$ curl -i http://localhost:8080/health
HTTP/1.1 200 OK

{"status": "ok"}
```

A healthy answer. A failing check would return an error code, and traffic would move away.

## Why it matters

Machines use it to spot a broken copy in seconds. A person would take far longer.

## Common mistake

A health check that only says the app is running. It should also test what the app needs, like its database.

## Three principles

- **Small and fast.** It answers in well under a second.
- **Checked often.** Every few seconds, by a machine.
- **Alive or ready.** Restart it, or just hold traffic back.

## Related terms

- [High Availability (HA)](https://learn.benibix.com/term/infrastructure/high-availability)
- [Load Balancer](https://learn.benibix.com/term/infrastructure/load-balancer)
- [Uptime Monitoring](https://learn.benibix.com/term/infrastructure/uptime-monitoring)
- [Kubernetes Pod](https://learn.benibix.com/term/infrastructure/kubernetes-pod)
- [HTTP Status Code](https://learn.benibix.com/term/infrastructure/http-status-code)
- [Fault Tolerance](https://learn.benibix.com/term/infrastructure/fault-tolerance)
- [Failover](https://learn.benibix.com/term/infrastructure/failover)

![A load balancer at the top sends traffic down to three servers. The middle server is drawn dashed, and its health check says fail. The load balancer has stopped sending it traffic, and the two other servers carry on serving users.](https://learn.benibix.com/diagrams/inf-high-availability.svg)

---

Source: https://learn.benibix.com/term/infrastructure/health-check
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-19
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
