API Doc
Search Docs...
⌘ K
ACOSABSAVEANSABDR

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 handling traffic.

When a server pool is configured with multiple health monitors simultaneously, a backend server is considered healthy only when all health monitors report its status as healthy.

The ANS network load balancer supports four health check methods:

  • TCP: Initiates a TCP connection request to a backend server to determine whether the server responds or 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.