Health Checks #
Your App’s tasks are checked for their health continuously. This is one of the most important measures to provide a reliable experience to your users because it ensures the reliable operation of the software you’re running on SetOps. When checks fail, the corresponding tasks are automatically restarted.
There are two types of checks:
-
the Network health check tests whether your App is responding to requests over the network
-
the Container health check tests your App’s overall health by running a customizable command.
The Network health check is enabled by default. However, it can be customized to work with how your App is laid out. The Container health check is optional.
You can configure health checks for thehttp
protocol only. If you’re using thetcp
protocol, you can not configure a health check.
Both checks serve related but different purposes. It’s important to understand the difference between the two to ensure your App runs reliably in case of faults:
-
The Network health check is used from the outside to determine whether to route traffic to your App. Ensure the App endpoint for this check is fast and reliable – the load balancer will send a request to this endpoint every second or so. When the network health check fails on several subsequent retries, the task is restarted automatically.
-
The Container health check is a command run inside your App’s container. This means you have full authority over what the command actually checks. When the Container health check fails after a user-configurable number of retries, the task is restarted automatically.
The check endpoint or command should perform a minimal set of checks to verify whether the App can serve traffic. It could check if the database connection works, for example. On the other hand, it should not check every linked service, or if a cronjob ran successfully – this might lead to undesired downtime, as such failures should not prevent the App from being accessible. For these kinds of checks, you should use another, non-critical monitoring method.
In the diagram below, you see how both types of checks interact with your App and how the Network health check differs from the Container health check.
Going further #
Configure Resources for your app.