Health Check
Active health check mainly means that APISIX actively detects the survivability of upstream nodes through preset probe types. APISIX supports three probe types: , HTTPS
, and TCP
.
When N consecutive probes sent to healthy node A
fail, the node will be marked as unhealthy, and the unhealthy node will be ignored by APISIX’s load balancer and cannot receive requests; if For an unhealthy node, if M consecutive probes are successful, the node will be re-marked as healthy and can be proxied.
If N
consecutive requests to a healthy node A fail, the node will be marked as unhealthy.
note
Since unhealthy nodes cannot receive requests, nodes cannot be re-marked as healthy using the passive health check strategy alone, so combining the active health check strategy is usually necessary.
tip
- We only start the health check when the upstream is hit by a request. There won’t be any health check if an upstream is configured but isn’t in used.
- If there is no healthy node can be chosen, we will continue to access the upstream.
- We won’t start the health check when the upstream only has one node, as we will access it whether this unique node is healthy or not.
Configuration example
If APISIX detects an unhealthy node, the following logs will be output in the error log:
tip
To observe the above log information, you need to adjust the error log level to .