ConceptsDeploys
Health checks
A health check is the test that a new instance must pass before it gets traffic.
Ferry tests each new instance one time each second.
1 / 3
The three tests
| Service | Test |
|---|---|
| Web, private or static, with a health check path | GET <path> must answer with a status below 400. |
| Web, private or static, without a path | The port must accept a TCP connection and keep it open. |
| Background worker | The process must run for 5 seconds. |
Set a health check path
ferry update api --health /healthzIn the dashboard, use Health check path in the settings.
Make an endpoint only for this test. It must answer quickly when the app is ready.
- Each 10 seconds, the log tells you why an instance is not healthy.
- If an instance stops during the test, the deploy fails immediately. Ferry copies the last 50 lines of its output into the deploy log.
- If the instance stops with exit code 0, the error gives the command and a hint. See The app exits right away.
- To change the 120 seconds, start
ferrydwith--health-check-timeout.
Ferry uses the health check path only during a deploy. After that, the proxy sends traffic to each instance whose port accepts connections. The reconciler replaces an instance that stops.
Ferry sends GET <path> to the instance with the hostname of the service in the Host header.