Adding or Removing Backend Servers (Shared Load Balancers)

Scenarios

A backend server group has at least a healthy backend server. 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.

Note

Backend servers can reside in different subnets of the same VPC.

Adding Backend Servers

  1. Log in to the management console.

  2. In the upper left corner of the page, click image1 and select the desired region and project.

  3. Hover on image2 in the upper left corner to display Service List and choose Network > Elastic Load Balancing.

  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, click Add in the upper left corner of the server list. Select the subnet where the backend servers reside, select the backend servers you want to add, and click Next.

    Note

    • If a backend server has multiple NICs, you can only select the subnet where the primary NIC resides and use the primary NIC to add the backend server.

    • Backend servers cannot use virtual IP addresses.

  7. Add the ports and configure the weights and click Finish.

    Note

    In the Backend Port text box, enter the port used by each backend server.

    If multiple backend servers use the same port, you can batch add the port in the Batch Add Port text box and then click Finish.

    If you want to set the same weight for multiple backend servers, you can batch configure the weights.

Removing Backend Servers

  1. Log in to the management console.

  2. In the upper left corner of the page, click image3 and select the desired region and project.

  3. Hover on image4 in the upper left corner to display Service List and choose Network > Elastic Load Balancing.

  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 of the backend server group, select the backend servers to be removed and click Remove above the server list.

  7. Click Yes.

Note

Disable Removal Protection if you want to remove servers from the backend server group.

Adding a Backend Server Group

  1. Log in to the management console.

  2. In the upper left corner of the page, click image5 and select the desired region and project.

  3. Hover on image6 in the upper left corner to display Service List and choose Network > Elastic Load Balancing.

  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 configuring 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 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.

    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.

    • Application cookie: The application deployed on the backend server generates a cookie after receiving the first request from the client. All requests with the same cookie generated by backend application are then routed to the same backend server.

    Note

    • Sticky sessions at Layer 4 (for TCP or UDP listeners): only Source IP address

    • Sticky sessions at Layer 7 (for HTTP or HTTPS listeners): Load balancer cookie and Application cookie. Choose an appropriate sticky session type to better distribute requests and improve load balancing.

    Load balancer cookie

    Cookie Name

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

    cookieName-qsps

    Stickiness Duration (min)

    Specifies the minutes that sticky sessions are maintained.

    • Layer 4:

      • Default: 20 minutes

      • Maximum: 60 minutes

      • Range: 1 minute to 60 minutes

    • Layer 7:

      • Default: 20 minutes

      • Maximum: 1,440 minutes

      • Range: 1 minute to 1,440 minutes

    Note

    If you have set Sticky Session Type to Application cookie, Stickiness Duration cannot be set.

    20

    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

    • 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 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)

    Specifies 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 image7 and select the desired region and project.

  3. Hover on image8 in the upper left corner to display Service List and choose Network > Elastic Load Balancing.

  4. Locate the load balancer and click its name.

  5. Click Backend Server Groups, locate the backend server group, and click image9 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 image10 and select the desired region and project.

  3. Hover on image11 in the upper left corner to display Service List and choose Network > Elastic Load Balancing.

  4. Locate the load balancer and click its name.

  5. Click Backend Server Groups, locate the backend server group, and click image12 on the right of its name.

  6. Click Yes.

Note

Disable Removal Protection if you want to remove servers from the backend server group.