UDP Health Check Exception

Last Updated At: 2025-11-26 10:53:01

This section covers troubleshooting issues related to Cloud Load Balancer. This aims to ensure that you, our valued customers, can easily resolve any problems with load balancing to ensure greater availability and distribution of workloads in your environment.

UDP Health Check Exception:
In the CLB UDP health check, the results are different from the actual status of the server port.

If the PING command is successful and an error message port XX unreachable is not returned within the response timeout period, the real server is considered healthy. Otherwise, the real server is considered unhealthy.

There are two possible causes for this error:
The response timeout period is too short for the real server to return an ICMP message reply or a port unreachable to the health check nodes, leading to an inaccurate health check result.
The real server restricts the rate at which ICMP messages are generated. In this case, when a service exception occurs, port XX unreachable cannot be returned, and the CLB instance considers that the health check is successful, as no ICMP response is received. Therefore, the health check result is inconsistent with the actual server health.

Troubleshooting steps:

  1. Check if the response timeout is too short. Log into the CLB Console, and increase the timeout duration of the UDP listener.

    Note:

    UDP health checks are different from other health checks. If the health check timeout period is too short, the health check result will switch back and forth between healthy and unhealthy.

  2. If the error persists, check whether the real server restricts the frequency of ICMP messages. Log in to the real server, and run the following commands to check the rate limit.

    sysctl -q net.ipv4.icmp_ratelimit
    sysctl -q net.ipv4.icmp_ratemask
    
  3. Check whether the return value of the first command is 0 or 1000 (default). We recommend using the default value.

  4. If the error persists, run the following command to disable the rate limit of the ICMP.

Note:
Note that if the rate limit of ICMP port unreachable messages is lifted, when the real server is connected to the public network and encounters UDP port scanning attack, it will keep returning port unreachable messages

# Run the command `net.ipv4.icmp_ratemask` in step 2 to query the rate mask

# Keep the first three digits of the returned rate mask unchanged, and subtract 8 from the last digit. For example, if the mask returned is “6168”, replace "xxxx" with 6160; if it is 1819, replace "xxxx" with 1811.

sysctl -w net.ipv4.icmp_ratemask=xxxx

Step 1. Configure a listener

Log in to the CLB Console and click Instance management in the left sidebar.

Select your region in the top-left corner of the CLB instance list and click Configure listener in the Operation column of the target instance.

Under TCP/UDP/TCP SSL/QUIC listener, click Create, and configure the UDP listener in the pop-up window.

3.1 Configure basic parameters

Parameter Description Example
Name Listener name. test-udp-8000
Listening protocol and port

Listening protocol: In this case, select UDP.

Listening port: The port used to receive requests and forward them to real servers. The port number ranges from 1 to 65535. Port 4789 is reserved for the system and is not yet unavailable.

A listening port must be unique in the same CLB instance.

UDP:8000
Balancing method

CLB supports two scheduling algorithms for UDP listeners: weighted round robin (WRR) and weighted least connections (WLC)

WRR: Requests are distributed to real servers in sequence based on their weights. This algorithm performs scheduling based on the number of new connections. Servers with higher weights are more likely to be scheduled and servers with the same weight process the same number of connections.

WLC: Loads of servers are estimated based on the number of active connections to the servers. This algorithm performs scheduling based on server loads and weights. For servers with the same weight, those have less loads are more likely to be scheduled.

Note: If WLC is selected, the listener does not support session persistence.

WRR
Schedule by QUIC ID

Once this feature is enabled, CLB will schedule client requests by QUIC ID, so requests with the same QUIC Connection ID will be scheduled to the same real server. If a request doesn't have a QUIC Connection ID, it will be downgraded to normal WRR scheduling, i.e., scheduling according to the quadruple (source IP address + destination IP address + source port + destination port).

Enabled
Configure ProxyProtocol

After checking, you can enable the ProxyProtocol configuration. It supports carrying the client's source address to the real server through the ProxyProtocol protocol.

Check and use

3.2 Configure health check

3.3 Configure session persistence

Parameter Description Example
Session persistence

After session persistence is enabled, a CLB listener will distribute access requests from the same client to the same real server.

UDP session persistence is implemented based on the client IP address. The access requests from the same IP address are forwarded to the same real server.

Session persistence can be enabled for WRR scheduling but not WLC scheduling.

Enabled
Hold Time

Session persistence duration.

Session persistence is terminated if there are no new requests in the connection within the specified duration.

Value range: 30-3600 seconds

30 seconds

Step 2. Bind a real server

On the Listener management page, click the created listener UDP:8000 to view the bound real servers on the right of the listener.
Click Bind, select the target real server, and configure the server port and weight in the pop-up window.

Note:

If you set the default port first and then select real servers, the port of every real server is the default port.

Step 3. Configure a security group (optional)

You can configure a CLB security group to isolate public network traffic.

Step 4. Modify or delete a listener (optional)

If you need to modify or delete a created listener, click the listener on the Listener management page and click Edit for modification or Delete for deletion.