All Products
Search
Document Center

ENS:Configure a TCP listener

Last Updated:Sep 09, 2026

TCP listeners are ideal for services that prioritize high data accuracy and reliability over speed, such as file transfers, email, and remote logins. You can add a TCP listener to an ELB instance to forward TCP requests from clients to backend servers.

Prerequisites

You have created an ELB instance. For more information, see Create an ELB instance.

Procedure

  1. Log on to the ENS console.

  2. On the ELB Instance management page, find the target instance, and in the Actions column, click Listener Configuration.

  3. On the Listeners tab, click Add Listener.

  4. Configure the basic settings.

    Parameter

    Description

    Listener name

    Enter a name for the listener.

    Load balancing protocol

    Select TCP.

    Listener port

    The port on the ELB instance that listens for requests and forwards them to backend servers. The port number must be from 1 to 65535.

    Advanced settings

    Note

    Click Modify to expand the advanced settings.

    Scheduling algorithm

    • Weighted Round-Robin (WRR): Backend servers with higher weights receive more requests.

    • Round-Robin (RR): Distributes incoming requests to backend servers in sequence.

    • Weighted Least Connections (WLC): Distributes requests based on both the weight and number of active connections for each backend server. Among servers with the same weight, the one with the fewest active connections receives the next request.

    • Consistent Hashing (CH): Routes requests based on the source IP address. Requests from the same source IP address are always routed to the same backend server.

    Session persistence

    Specify whether to enable session persistence.

    Note

    When session persistence is enabled, the listener routes requests from the same client to the same backend server.

    Session persistence timeout

    Specify the timeout period for TCP session persistence.

    • The session closes automatically if no new requests are received within the timeout period.

    • Valid values: 1 to 3,600.

    • Unit: seconds.

    Connection timeout

    Specify the timeout period for an idle TCP connection.

    • The load balancer closes the connection if it remains idle for longer than this period.

    • Valid values: 10 to 900.

    • Unit: seconds.

    Obtain Client IP Address

    For Layer 4 listeners, backend servers can directly obtain the client's source IP address. This feature is enabled by default.

  5. Click Next to configure health checks. For details about the parameters, see Health checks.

  6. After you configure health checks, click Next. Review the configuration details, and then click Create.

  7. After the listener is created, you must start it. On the Listeners tab, find the listener and click Start in the Actions column.