How to create a UDP Listener
A UDP listener is a component that receives incoming traffic and efficiently distributes it to all connected backend servers. It operates using a specified UDP protocol and port to monitor connection requests, determining the optimal routing for these requests to the registered targets. This component enhances the fault tolerance of your infrastructure, ensuring reliable performance and improved resilience.
To create and start using a listener:
1. Go to the UDP listeners tab and click Create UDP listener.
2. Choose whether to assign the listener to a high availability (HA) cluster or a standalone server. Ensure that you have already created the HA cluster or added a server.
3. If you select the HA cluster, fill out the following fields:
- Name — enter a name for your listener.
- High availability cluster — select the high availability cluster to which you want to assign the listener.
- VIP — select the VIP (virtual IP address) of your cluster, which will be used to receive incoming traffic.
- Port — specify the UDP port number on which the listener will receive requests.
- Balancing type — select the load balancing algorithm for your listener.
- Backend servers — provide details for your backend servers, including their IP addresses, port numbers, and weights. These servers will receive the incoming traffic redirected by the listener.
- Enable backends checking — check this box to enable backends checking and set the following parameters: the interval (in seconds) between checks, the delay between successive retries, and the maximum number of retries allowed.
- Description — add a description if necessary.
If you select a standalone server, fill out the following fields:
- Name — enter a name for your listener.
- Server — select the server to which you want to assign the listener.
- IP — enter the IP address of your server, which will be used to receive incoming traffic.
- Port — specify the UDP port number on which the listener will receive requests.
- Balancing type — select the load balancing algorithm for your listener.
- Backend servers — provide details for your backend servers, including their IP addresses, port numbers, and weights. These servers will receive the incoming traffic redirected by the listener.
- Enable backends checking — check this box to enable backends checking and set the following parameters: the interval (in seconds) between checks, the delay between successive retries, and the maximum number of retries allowed.
- Description — add a description if necessary.
As mentioned earlier, you can choose a load balancing algorithm for your UDP listener. The available algorithms are as follows:
- Round robin — this algorithm distributes incoming requests sequentially across a list of available servers. Each server receives a request in turn, ensuring that all servers are utilized evenly over time.
- Weighted round robin — similar to round robin, this algorithm assigns a weight to each server based on its capacity or performance. Servers with higher weights receive more requests than those with lower weights. This allows for a more efficient distribution of traffic, especially when servers have varying capabilities.
- Least connection — this algorithm routes incoming traffic to the server with the fewest active connections, ensuring that no single server becomes overwhelmed while others remain underutilized.
- Weighted least connection — similar to least connection, this algorithm assigns weights to servers based on their capacity. Servers with fewer connections and higher weights receive more traffic, optimizing resource utilization while balancing the load effectively.
- Source hashing — this algorithm uses a hash function to map incoming request IP addresses to specific servers, ensuring that requests from the same client are consistently directed to the same server for session persistence and caching.
- Destination hashing — similar to source hashing, this algorithm hashes the destination IP address of incoming requests to determine the handling server, helping to distribute load for applications with multiple endpoints.
- Locality-based least connection — this algorithm combines locality awareness with the least connection method, directing traffic to the geographically closest server with the fewest connections to reduce latency and improve response times while balancing load distribution.
4. Click Save to create the listener configuration, which will then appear on the UDP listeners page, or click Apply to assign the newly created listener to your cluster or server.
Once created, the listener will be displayed on the UDP listeners page. Here, you can manage it using the buttons located to the right of the listener's name. These buttons allow you to run, restart, stop, edit, or delete the listener, as well as view its action history.