Health Checks
Health checks are endpoints that indicate if an application is healthy and ready to receive traffic. When health checks are enabled, traffic won’t switch from the old application instance until the health check indicates that the application is ready. On health check endpoints, the application should return200 status when the application should receive traffic, and a 500-level error otherwise. Health checks can be configured in the Advanced tab.
For example, in the screenshot above, no traffic will be routed to the web service until the /healthz endpoint returns a 200 status code.
Readiness probes should be used in conjunction with graceful shutdown behavior
to control exactly when applications stop receiving traffic. See the graceful
shutdown section for more information.
Graceful Shutdown
While applications are being re-deployed, the old application instances will receive a termination signal in the form ofSIGTERM. The applications are then given a Termination Grace Period, which is the number of seconds after SIGTERM is sent before the application will be forcefully killed. In this time, the application should stop receiving traffic, close any existing connections, and exit gracefully. The termination grace period can also be configured from the Advanced tab.
Note that the application will continue to receive traffic until it exits, unless you have configured the readiness probe to fail before this time. Thus, the recommended graceful shutdown sequence is:
- As soon as
SIGTERMis received, return a500-level response code on the readiness probe endpoint (see above for more information). - Since the
SIGTERMhas been issued to your app, the termination grace period is in effect - this is when your app needs to close the server to prevent additional connections, and drain all existing connections before the grace period ends. Exit gracefully after connections are drained.

