Help Center> Elastic Load Balance> User Guide> Backend Server> Configuring Weights for Backend Servers

Configuring Weights for Backend Servers

Each backend server can be given a numeral value from 0 to 100 to indicate the proportion of requests to receive. Requests will not be routed to the backend server whose weight is 0, even if the backend server is considered healthy. You can set a weight for each backend server when you select one of the following algorithms:
  • Weighted round robin: If none of the servers have a weight of 0, the load balancer routes requests to these servers using the round robin algorithm based on their weights. If the weights of backend servers are the same, the load balancer distributes requests using the round robin algorithm.
  • Weighted least connections: If none of the servers have a weight of 0, the load balancer calculates the load of each backend server using the formula: Overhead = Number of current connections/Server weight. The load balancer routes requests to the backend server with the lowest overhead in each request distribution.
  • Source IP hash: Requests will not be routed to backend servers if their weights are set to 0. Server weights do not take effect if they are not 0, and requests from the same IP address are routed to the same backend server.

Procedure

  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 then the server, and click the number in the Weight column to set the server weight.
  6. Click OK.

To batch set the server weights, perform the following operations:

  1. Perform 1 to 4.
  2. Click Backend Server Groups, locate the backend server group and select the backend servers for which you want to set the weights, and click Modify Weight.
  3. In the displayed Modify Weight dialog box, enter a weight for each server in the text box.

    You can also set the weight in the backend server list.

  4. Click OK.

If you set the weights of all backend servers to 0, these backend servers will not receive requests.