Skip to Content
Configure an app

Health checks and automatic restarts

Check that an app really answers, and let Deplo restart it when it stops.

Deplo asks every app with a domain whether it still answers, and restarts it when it does not. This is on by default.

Set your own health check

Your own check decides what "answering" means. For a single-image app.

Turn it on

Open the app, then Settings -> Advanced, and turn on Health check.

Pick the check

  • HTTP request: a Path, like /healthz. Any status under 400 is healthy. Fill Port only if the check answers on another port than the app's.
  • Command: a shell line that exits 0 when things are fine, like pg_isready -U app.

Set the timings, then save

FieldWhat it meansDefault
IntervalSeconds between checks30
TimeoutSeconds one check may take, shorter than the interval5
RetriesFailures in a row before the app is unhealthy3
Start periodSeconds of grace while the app boots10

Save. The check starts with the next deploy.

What gets checked

The app hasWhat Deplo asksRestarted after
A domain, no check of its ownGET / every 30 seconds. Any answer counts, a 404 too3 failures in a row
Its own health checkYour checkRetries failures in a row
No domain, no checkNothingOnly a crash restarts it

Give a worker with no domain a Command check to have it restarted when it hangs.

Reading the result

The status shows on the app's badge, on the Overview and on Monitoring.

  • Healthy: the last check was answered.
  • Unhealthy: running, but it failed enough checks in a row.
  • Starting: inside the start period.

Error is not unhealthy

Error means the last deploy failed. An app can be Error and healthy at once, because the previous version is still serving.

Automatic restarts

Deplo restarts an app that crashes or stops answering, until restarting clearly does not help:

The appDeplo stops trying afterThen
Is up but does not answer5 restarts in 30 minutesThe app keeps running and reads Not answering · restarts paused
Crashes10 restarts in 30 minutesThe app is stopped. Logs reads Stopped, with a Start button

Paused restarts resume after your next deploy, a manual restart, or 30 minutes with no failed check. A deploy also starts the crash count again.

You get the alerts App stopped answering at the first restart, App still not answering when restarts pause, and App keeps restarting when a crashing app is stopped. Activity records each restart for not answering, and each stop.

Both switches are in the app's Settings -> Advanced:

  • Restart when it stops answering: turn it off for an app meant to be slow to answer. It applies from the next deploy.
  • Restart loop protection, on a database too: turn it off to let a container keep crashing. It applies at once.

Good to know

  • An unhealthy app keeps its traffic. A check never changes routing.
  • Each replica is checked on its own. One stuck replica restarts while the others serve.

Something wrong? See Deploys and builds.

Did this page help you?

On this page