API Doc
Search Docs...
⌘ K
ACOSABSAVEANSABDRAKEObservability

Health check

The health monitor is responsible for checking the health status of backend servers. When a backend server is detected as abnormal, client requests are automatically forwarded to other healthy backend servers. When the abnormal backend server returns to normal, it is automatically restored to the load balancing service to continue carrying workload traffic.

When a server pool is configured with multiple health monitors, L4 virtual services use all these monitors to check backend server status and consider a backend server healthy only when all health monitor results are healthy. An L7 virtual service uses only one health monitor. The system automatically selects one according to the priority gRPC > HTTP > TCP.

ANS load balancing supports multiple health check methods. L4 load balancing supports four proactive health check methods: TCP, HTTP, UDP, and ICMP. L7 load balancing supports three proactive health check methods: TCP, HTTP, and gRPC.

  • TCP: Initiates a TCP connection request to a backend server to determine whether the server responds or the request times out.

    The process is as follows:

    1. Based on the health check configuration, sends a TCP SYN packet to the backend server (IP + health check port).

    2. If the corresponding port on the backend server is listening normally, the server returns a SYN + ACK packet.

    3. If a response packet is received from the backend server within the timeout period, the service is considered to be running normally and the health check is successful. If no response packet is received within the timeout period, the service is considered unresponsive and the health check fails.

  • UDP: Initiates a UDP request to a backend server, relying on ICMP error messages to determine whether the server is healthy.

    The process is as follows:

    1. Based on the health check configuration, sends an ICMP Echo Request packet to the backend server.

    2. If no ICMP Echo Reply packet is received within the timeout period, the health check fails.

    3. If an ICMP Echo Reply packet is received within the timeout period, a UDP probe packet is sent to the backend server.

    4. If no ICMP Port Unreachable packet is received from the backend server within the timeout period, the health check is successful. Otherwise, the health check fails.

  • HTTP: Initiates an HTTP GET request to a specified URL and determines whether the backend server is healthy based on the response or status code.

    The process is as follows:

    1. Based on the health check configuration, sends an HTTP GET request to the backend server (IP + port + check path).

    2. The backend server returns an HTTP status code based on the service status.

    3. If a response is received from the backend server within the response timeout period and the HTTP status code matches the expected value, the health check is successful. If no response is received within the timeout period or the HTTP status code does not match, the health check fails.

  • ICMP: Sends a ping to the backend server to determine whether the host is alive.

    The process is as follows:

    1. Based on the health check configuration, sends an ICMP Echo Request packet to the backend server.

    2. If an ICMP Echo Reply packet is received within the timeout period, the health check is successful. If no ICMP Echo Reply packet is received within the timeout period, the health check fails.

  • gRPC: Proactively probes backend service status through the standard gRPC health checking protocol and determines whether a backend server is healthy based on whether the response status is SERVING.

    The process is as follows:

    1. Based on the health check configuration, sends a gRPC health check request to the backend server.

    2. The backend server returns its current service status.

    3. If a response is received from the backend server within the response timeout period and the response status is SERVING, the health check is successful. Otherwise, the health check fails.