Health checks on Aptible Deploy can operate in two modes:
In this mode (the default), Aptible Deploy expects your App Containers to respond to health checks with any valid HTTP response, and does not care about the status code.
When Strict Health Checks are enabled, Aptible Deploy expects your App Containers to respond to health checks with a
200 OK HTTP response. Any other response will be considered a failure.
Strict Health Checks are useful if you're doing further checking in your app to validate that it's up and running.
To enable Strict Health Checks, set the
STRICT_HEALTH_CHECKS Configuration variable on your App to the value
true. This will setting apply to all Endpoints associated with your App.
Redirections are not
200 OKresponses, so be careful with e.g. SSL redirections in your app that could cause your app to respond to the health check with a redirect, such as Rails'
config.force_ssl = true.
Overall, we strongly recommend verifying your logs first to check that you are indeed returning
/healthcheckbefore enabling Strict Health Checks.
Aptible Deploy performs health checks at two stages:
- Release Health Checks when releasing new app Containers.
- Runtime Health Checks throughout the lifecycle of your app Containers.
When deploying your app, Aptible Deploy ensures that new app containers are receiving traffic before they're registered with load balancers.
By default, Aptible Deploy 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
This health check is only executed if your Service is scaled to 2 or more Containers.
When your app is live, Aptible Deploy periodically runs a health check to ensure that your Containers are still accepting traffic:
- 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.
This health check is performed as a HTTP request sent to
/healthcheck. Your app must respond with a 200 if Strict Health Checks are enabled, and with any status code otherwise. See Endpoint Logs for information about how Runtime Health Checks error logs can be viewed.
If needed, you can identify requests to
/healthcheckcoming from Aptible Deploy: they'll have the
Updated 6 months ago