Health Checks

HTTP(S) Endpoints perform health checks on your app in two situations:

Release Health Checks

When deploying your app, Enclave ensures that new app containers are receiving traffic before they’re registered with load balancers.

To do so, Enclave sends a HTTP request to your app on / on its Container Port. Your app needs to respond with any valid HTTP response to pass the health check (the status code does not matter).

Release Health Check Timeout

By default, Enclave waits for up to 3 minutes for your app to respond. If needed, you can increase that timeout by setting the RELEASE_HEALTHCHECK_TIMEOUT Configuration variable on your app.

This variable must be set to your desired timeout in seconds. Any value from 0 to 900 (15 minutes) seconds is valid (we recommend that you avoid setting this to anything below 1 minute).

You can set this variable using the aptible config:set command:

aptible config:set --app "$APP_HANDLE" \
        RELEASE_HEALTHCHECK_TIMEOUT=600

Runtime Health Checks

Note

This health check is only executed if your Service is scaled to 2 or more Containers.

When your app is live, Enclave periodically runs a health check to ensure that your Containers are still accepting traffic.

This health check is performed as a HTTP request sent to /healthcheck. Your app needs to respond with any valid HTTP response to pass the health check (the status code does not matter).

  • If one or more of your App Containers are not passing the health check, traffic will be routed to other healthy containers.
  • If none of your App Containers are passing the health check, traffic will be routed to Brickwall.

Tip

If needed, you can identify requests to /healthcheck coming from Enclave: they’ll have the X-Aptible-Health-Check header set.