Add a TCP listener to your Edge Load Balancer (ELB) instance to forward TCP traffic to backend servers. TCP listeners are suited for workloads that require data consistency, reliability, and integrity — such as file transfer, email services, and remote login — and can tolerate a relatively low transmission speed.
Prerequisites
Before you begin, ensure that you have:
An ELB instance. See Create an ELB instance.
Add a TCP listener
Log on to the ENS console.
On the ELB Instance page, find the target ELB instance and click Listener Configuration in the Actions column.
On the Listener tab, click Add Listener.
Configure the listener parameters.
Parameter Description Example Listener Name A name for the listener. tcp-listener-80ELB Protocol Select TCP. TCP Listener Port The port on which ELB receives and forwards requests to backend servers. Valid values: 1–65535. 80Click Modify under Advanced Settings and configure the following parameters.
Parameter Description Example Scheduling algorithm The algorithm used to distribute requests across backend servers. See Choose a scheduling algorithm for details. WRR Session persistence Whether to forward all requests from the same client to the same backend server. When enabled, configure the timeout period below. Enabled Session persistence timeout period How long ELB maintains a session when no new requests arrive. After the timeout, the session is automatically disconnected. Valid values: 1–3600 seconds. 300Connection timeout period How long ELB keeps an idle TCP connection open. After the timeout, ELB automatically closes the connection. Valid values: 10–900 seconds. 60Obtain Client IP Address Whether to pass the original client IP address to backend servers. Only Layer 4 listeners support this feature. Enabled by default. Enabled Click Next and configure health checks. See Configure health checks.
Click Next, review the configuration, and click Create.
On the Listener tab, find the listener and click Enable in the Actions column.
Choose a scheduling algorithm
Select the algorithm that best matches your traffic pattern and session requirements.
| Algorithm | How it works |
|---|---|
| Weighted Round-Robin (WRR) | Distributes requests based on server weights. Servers with higher weights receive proportionally more requests. |
| Round-Robin (RR) | Distributes requests to backend servers in sequence, regardless of weight or load. |
| Weighted Least Connections (WLC) | Routes each request to the server with the fewest active connections, adjusted by weight. If weights are equal, the least-loaded server gets the request. |
| Consistent Hashing (CH) | Uses source IP-based consistent hashing. Requests from the same client IP always go to the same backend server. |