You can create a UDP listener to a CLB instance to forward UDP requests from the client. UDP is suitable for scenarios that have high requirements for transfer speed but relatively low requirements for accuracy, such as instant messaging and online videos. For UDP listeners, the real server can directly get the real client IP.
Port 4789 of the UDP listener is a system reserved port and unavailable yet.
You need to create a CLB instance as instructed in Creating CLB Instances first.
Step 1. Configure a listener
- Log in to the CLB console and click Instance Management on the left sidebar.
- Select a region in the top-left corner of the CLB instance list page and click Configure Listener in the Operation column on the right.
- Under TCP/UDP/TCP SSL/QUIC Listener, click Create and configure the UDP listener in the Create Listener pop-up window.
1. Basic Configuration
2. Health check
|Listener Protocol and Ports
- Listener protocol: UDP is used in this example.
- Listener port: A port used to receive requests and forward them to the real server. Port range: 1-65535. Port 4789 is a system reserved port and is unavailable yet.
- The listener port must be unique in the same CLB instance.
||For UDP listeners, CLB supports two scheduling algorithms: weighted round robin (WRR) and weighted least connections (WLC).
- WRR: Requests are sequentially delivered to different real servers according to their weights. Scheduling is done based on the number of new connections, where servers with higher weights will undergo more polls (i.e., a higher probability), while servers with the same weight process the same number of connections.
- WLC: Loads of servers are estimated according to the number of active connections to the servers. Scheduling is done based on server loads and weights. If their weights are the same, servers with fewer active connections will undergo more polls (i.e., a higher probability).
If WLC is selected, the listener does not support session persistence.
|Scheduling 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 + destination IP + source port + destination port).
For details of health check, see Configuring Health Check
3. Session persistence
|Session Persistence Configuration
|Session Persistence Switch
- If session persistence is enabled, the CLB listener will deliver the access requests from the same client to the same real server.
- TCP session persistence is implemented based on client IP addresses, that is, 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.
|Session Persistence Duration
||Session persistence duration
- If there is no new request within the connection beyond the session persistence duration, session persistence will be disabled automatically.
- Value range: 30-3600s.
Step 2. Bind a backend CVM
- 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.
Default port: Enter the Default Port first and then select the CVM instance. The port of every CVM instance is the default port.
Step 3. Configure a security group (optional)
You can configure a CLB security group to isolate public network traffic. For more information, see Configuring CLB Security Group.
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 for modification or for deletion.