Updated on 2023-05-18 GMT+08:00

Adding or Removing Backend Servers (Dedicated Load Balancers)

Scenarios

When you use ELB, ensure that at least a healthy backend server is in the backend server group associated with your load balancer. If incoming traffic increases, you need to add more backend servers.

After a backend server is removed, it cannot receive requests from the load balancer. You can add it back to the backend server group when the traffic goes up again.

If the load balancer is associated with an AS group, instances in the AS group are automatically added to the backend server group associated with the load balancer. If instances are removed from the AS group, they will be automatically removed from the backend server group.

Prerequisites

If you want to add IP as backend servers to handle requests, you must configure the routes correctly to ensure requests are routed to these backend servers.

IP as Backend Servers

If you enable IP as a backend, you can add backend servers that are not in the VPC of the load balancer as well as load balancers on a private network, using their private IP addresses. The backend servers can be in a VPC connected through a VPC peering connection, in a VPC in another region and connected through a cloud connection, or in an on-premises data center at the other end of a Direct Connect or VPN connection.

When you add IP as backend servers, note the following:
  • If you do not enable the function when you create a load balancer, you can still enable it on the Basic Information page of the load balancer.
  • IP as backend servers must use IPv4 addresses.
  • Configure the VPC routes correctly to ensure that backend servers are reachable. For details, see Adding or Removing Backend Servers (Dedicated Load Balancers).
  • If you enable IP as a backend for a load balancer, you can add only TCP, HTTP, and HTTPS listeners to the load balancer.
  • The subnet where the load balancer works must have sufficient IP addresses (at least 16 IP addresses). You can add more subnets for more IP addresses on the Basic Information page of the load balancer.
  • Security group rules of IP as backend servers must allow traffic from the subnet of the load balancer. Otherwise, health checks will fail.
  • IP as backend cannot be disabled after it is enabled.
  • A maximum of 492 servers can be associated with a load balancer.
  • Source IP addresses of the clients cannot be passed to IP as backend servers. Install the TOA module to obtain source IP addresses.

The IP as a backend function applies only to dedicated load balancers.

To add servers in the same VPC as the load balancer, you need to establish a VPC peering connection between the two VPCs. For details, see Routing Traffic to Backend Servers in the Same VPC as the Load Balancer.

Adding Backend Servers

  1. Log in to the management console.
  2. In the upper left corner of the page, click and select the desired region and project.
  3. Hover on in the upper left corner to display Service List and choose Networking > Elastic Load Balance.
  4. Locate the load balancer and click its name.
  5. Click Backend Server Groups, locate the backend server group, and click its name.
  6. On the Basic Information page, click Backend Servers, or IP as Backend Servers.
  7. Perform either of the following operations based on the type of the backend servers you want to add.
    • Backend servers in the same VPC as the load balancer: Click Add Backend Server. In the displayed dialog box, select the subnet where the backend servers reside, select the backend servers to be added, select the private IP address, and click Next. Add backend ports and configure the server weights, and click Finish.
    • IP as backend servers: Click Add IP as Backend Server. In the displayed dialog box, specify the IP addresses, ports, and weights, and click OK.

Removing Backend Servers

  1. Log in to the management console.
  2. In the upper left corner of the page, click and select the desired region and project.
  3. Hover on in the upper left corner to display Service List and choose Networking > Elastic Load Balance.
  4. Locate the load balancer and click its name.
  5. Click Backend Server Groups, locate the backend server group, and click its name.
  6. On the Basic Information page, click Backend Servers, or IP as Backend Servers.
  7. Perform either of the following operations based on the type of the backend servers you want to remove.
    • Select the cloud servers you want to remove and click Remove. In the displayed dialog box, click Yes.
    • Select the IP as backend servers you want to remove and click Remove. In the displayed dialog box, click Yes.

Adding a Backend Server Group

  1. Log in to the management console.
  2. In the upper left corner of the page, click and select the desired region and project.
  3. Hover on in the upper left corner to display Service List and choose Networking > Elastic Load Balance.
  4. Locate the load balancer and click its name.
  5. Under Backend Server Groups, click Add Backend Server Group.
  6. In the Add Backend Server Group dialog box, configure the parameters.

    Configure the parameters based on Table 1 and Table 2.

    Table 1 Parameters for adding a backend server group

    Parameter

    Description

    Example Value

    Name

    Specifies the name of the backend server group.

    server_group-sq4v

    Backend Protocol

    Specifies the protocol used by backend servers to receive requests.

    The backend protocol can be HTTPS, QUIC, TCP, UDP, or HTTP.

    HTTP

    Load Balancing Algorithm

    Specifies the algorithm used by the load balancer to distribute traffic. The following options are available:

    • Weighted round robin: Requests are routed to different servers based on their weights, which indicate server processing performance. Backend servers with higher weights receive proportionately more requests, whereas equal-weighted servers receive the same number of requests.
    • Weighted least connections: In addition to the number of active connections established with each backend server, each server is assigned a weight based on their processing capability. Requests are routed to the server with the lowest connections-to-weight ratio.
    • Source IP hash: The source IP address of each request is calculated using the consistent hashing algorithm to obtain a unique hashing key, and all backend servers are numbered. The generated key is used to allocate the client to a particular server. This allows requests from different clients to be routed based on source IP addresses and ensures that a client is directed to the same server that it was using previously.
    • Connection ID: The connection ID in the packet is calculated using the consistent hash algorithm to obtain a specific value, and backend servers are numbered. The generated value determines to which backend server the requests are routed. This allows requests with different connection IDs to be routed to different backend servers and ensures that requests with the same connection ID are routed to the same backend server. This algorithm applies to QUIC requests.
    NOTE:
    • Choose an appropriate algorithm based on your requirements for better traffic distribution.
    • For Weighted round robin or Weighted least connections, no requests will be routed to a server with a weight of 0.

    Weighted round robin

    Sticky Session

    Specifies whether to enable sticky sessions. If you enable sticky sessions, all requests from a client are sent to the same backend server.

    NOTE:

    You can enable sticky sessions only if you select Weighted round robin for Load Balancing Algorithm.

    -

    Sticky Session Type

    After you enable the sticky session feature, select a sticky session type:

    • Source IP address: The source IP address of each request is calculated using the consistent hashing algorithm to obtain a unique hashing key, and all backend servers are numbered. The system allocates the client to a particular server based on the generated key. This enables requests from different clients to be routed and ensures that a client is directed to the same server that it was using previously.
    • Load balancer cookie: The load balancer generates a cookie after receiving a request from the client. All subsequent requests with the same cookie are then routed to the same backend server.

    Load balancer cookie

    Stickiness Duration (min)

    Specifies the minutes that sticky sessions are maintained.

    • Layer 4:
      • Default: 20 minutes
      • Maximum: 1 hour
      • Range: 1 minute to 60 minutes
    • Layer 7:
      • Default: 20 minutes
      • Maximum: 24 hours
      • Range: 1 minute to 1,440 minutes

    20

    Slow Start

    Specifies whether to enable slow start, which is disabled by default.

    After you enable slow start, the load balancer linearly increases the proportion of requests to send to backend servers in this mode. When the slow start duration elapses, the load balancer sends full share of requests to backend servers and exits the slow start mode. For details, see Configuring Slow Start (Dedicated Load Balancers).

    -

    Slow Start Duration

    Specifies how long the slow start will last.

    The duration ranges from 30 to 1200, in seconds, and the default value is 30.

    30

    Description

    Provides supplementary information about the backend server group.

    You can enter a maximum of 255 characters.

    -

    Table 2 Parameters for configuring a health check

    Parameter

    Description

    Example Value

    Enable Health Check

    Specifies whether to enable health checks.

    N/A

    Protocol

    Health check protocols include TCP, HTTPS and HTTP.

    HTTP

    Domain Name

    Specifies the domain name that will be used for health checks.

    The domain name can contain digits, letters, hyphens (-), and periods (.), and must start with a digit or letter. Configure this parameter only if you have set Protocol to HTTP.

    www.elb.com

    Port

    Specifies the port used by the load balancer to perform health checks on backend servers. The port number ranges from 1 to 65535.

    NOTE:

    If you do not specify a health check port, the backend port will be used for health checks by default. If you specify a port, it will be used for health checks.

    80

    Check Path

    Specifies the health check URL, which is the destination on backend servers for health checks. Configure this parameter only if you have set Protocol to HTTP. The check path must start with a slash (/) and can contain 1 to 80 characters.

    The value can contain letters, digits, hyphens (-), slashes (/), periods (.), percent signs (%), ampersands (&), and the following special characters: _~';@$*+,=!:()

    /index.html

    Advanced Settings

    Interval (s)

    The maximum time between two consecutive health checks, in seconds.

    The interval ranges from 1 to 50.

    5

    Timeout (s)

    Specifies the maximum time required for waiting for a response from the health check, in seconds. The timeout duration ranges from 1 to 50.

    3

    Maximum Retries

    Specifies the maximum number of health check retries. The value ranges from 1 to 10.

    3

  7. Click OK.

Modifying a Backend Server Group

  1. Log in to the management console.
  2. In the upper left corner of the page, click and select the desired region and project.
  3. Hover on in the upper left corner to display Service List and choose Networking > Elastic Load Balance.
  4. Locate the load balancer and click its name.
  5. Click Backend Server Groups, locate the backend server group, and click on the right of its name.
  6. Modify the parameters as needed and click OK.

Deleting a Backend Server Group

  1. Log in to the management console.
  2. In the upper left corner of the page, click and select the desired region and project.
  3. Hover on in the upper left corner to display Service List and choose Networking > Elastic Load Balance.
  4. Locate the load balancer and click its name.
  5. Click Backend Server Groups, locate the backend server group, and click on the right of its name.
  6. Click Yes.