Help Center> Elastic Load Balance> User Guide> Backend Server> Adding or Removing Backend Servers (Dedicated Load Balancers)

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 the number of requests 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 a 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 cross-VPC backend servers, you must have configured the routes to ensure that cross-VPC backend servers are reachable.

Constraints

When you add cross-VPC backend servers, note the following:
  • If you do not enable the function when you create a load balancer, you need to enable it on the Basic Information page of the load balancer. Otherwise, cross-VPC backend servers cannot be added.
  • Cross-VPC backend servers must use IPv4 addresses. These IP addresses cannot be public IP addresses or IP addresses from the CIDR block of the VPC where the load balancer is deployed. Otherwise, requests cannot be routed to backend servers.
  • Only TCP, HTTP, and HTTPS listeners support this function.
  • The subnet of the load balancer must have sufficient IP addresses. Otherwise, cross-VPC backend servers cannot be added. You can add more subnets for more IP addresses on the Basic Information page of the load balancer.
  • Security group rules of cross-VPC backend servers must allow traffic from the subnet of the load balancer. Otherwise, health checks will fail.
  • This function cannot be disabled after it is enabled.
  • For cross-VPC backend servers, transparent transmission of client IP addresses becomes invalid by default. Obtain the client IP addresses by referring to TOA module.
  • You can add backend servers that are in the same VPC as the load balancer or backend servers that are not in the VPC where the load balancer is deployed. To add cross-VPC backend servers, you must configure the routes correctly. For details, see Adding or Removing Backend Servers (Dedicated Load Balancers).

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. Click Service List. Under Network, click Elastic Load Balance.
  4. Locate the load balancer and click its name.
  5. On the Backend Server Groups tab page, click Add Backend Server under Backend Servers, Add Cross-VPC Backend Server under Cross-VPC Backend Servers.
  6. In the Add Backend Server dialog box, select the subnet where the backend servers reside, select the backend servers to be added, and click Next. Set the server weights and backend ports, and click Finish.

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. Click Service List. Under Network, click 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. In the Basic Information area, locate the target backend server and click Remove in the Operation column. To remove multiple backend servers, select the backend servers you want to remove and click Remove above the server list.
  7. 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. Click Service List. Under Network, click 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.
    For details about the parameters, see Table 1 and Table 2.
    Table 1 Parameters for adding a backend server group

    Parameter

    Definition

    Example Value

    Name

    Specifies the backend server group name.

    server_group-sq4v

    Backend Protocol

    Specifies the protocol used by backend servers to receive requests.

    HTTP

    Load Balancing Algorithm

    Specifies the algorithm the load balancer uses to distribute traffic.

    • 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: This algorithm is designed based on the least connections algorithm that uses the number of active connections to each backend server to make its load balancing decision. In addition to the number of connections, each server is assigned with 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 the request is input into a hash algorithm, and the resulting hash is used to identify a server in the static fragment table.
    NOTE:

    Choose an appropriate algorithm based on your requirement to distribute requests and improve load balancing capabilities.

    Weighted round robin

    Sticky Session

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

    NOTE:

    For HTTP and HTTPS listeners, enabling or disabling sticky sessions may cause few seconds of service interruption.

    N/A

    Sticky Session Type

    Specifies the sticky session type. The following options are available:

    • Source IP address: Requests with the same source IP address are routed to the same backend server.
    • Load balancer cookie: The load balancer generates a cookie after receiving a request from the client. All subsequent requests with the cookie are routed to the same backend server.
    • Application cookie: The application deployed on the backend server generates a cookie after receiving the first request from the client. All subsequent requests that contain the cookie will be processed by this backend server.
    NOTE:
    • Source IP address is the only choice available when TCP is used as the frontend protocol. If you select HTTP or HTTPS as the frontend protocol, the sticky session type can be Load balancer cookie or Application cookie. Choose an appropriate sticky session type to better distribute requests and improve load balancing.
    • Sticky sessions at Layer 4 are maintained for one minute, while sticky sessions at Layer 7 are maintained for 24 hours.

    Application cookie

    Cookie Name

    Specifies the cookie name. When you select Application cookie, enter a cookie name.

    cookieName-qsps

    Slow Start

    Specifies whether to enable slow start. After this function is enabled, the load balancer linearly increases the proportion of requests to backend servers in this mode. When the slow start duration expires, the load balancer sends full share of requests to backend servers and exits the slow start mode.

    N/A

    Slow Start Duration

    Specifies the duration of each slow start, in seconds.

    The duration ranges from 30 to 1200.

    30

    Description

    Provides supplementary information about the backend server group.

    N/A

    Table 2 Parameters for configuring a health check

    Parameter

    Description

    Example Value

    Enable Health Check

    Specifies whether to enable health checks.

    N/A

    Protocol

    • If the frontend protocol is TCP, HTTP or HTTPS, the health check protocol can be TCP or HTTP. The health check protocol cannot be changed once it is set.
    • If the frontend protocol is UDP, the health check protocol is UDP by default.

    HTTP

    Domain Name

    Specifies the domain name in the health check request. The domain name can contain digits, letters, hyphens (-), and periods (.), and must start with a digit or letter. The field is left blank by default and is available only when the health check protocol is HTTP.

    www.elb.com

    Port

    Specifies the port the load balancer uses to perform health checks on backend servers. This is an optional parameter.

    Port range: 1 to 65535

    NOTE:

    If no health check port is specified, backend ports are used for health checks by default. If a port is specified, it will be used for health checks.

    80

    Advanced Settings

    Provides some advanced features.

    Default

    Interval (s)

    Specifies the maximum time between health checks in the unit of second.

    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 the unit of second. The timeout duration ranges from 1 to 50.

    10

    Check Path

    Specifies the health check URL, which is the destination on backend servers for health checks. This parameter is available only when Protocol is set to HTTP. The path can contain 1 to 80 characters.

    /index.html

    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. Click Service List. Under Network, click 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. In the upper left corner of the page, click and select the desired region and project.
  4. Click Service List. Under Network, click Elastic Load Balance.
  5. Locate the load balancer and click its name.
  6. Click Backend Server Groups, locate the backend server group, and click on the right of its name.
  7. Click Yes.