tencent cloud

Application Load Balancer

Balancing Methods

Download
Focus Mode
Font Size
Last updated: 2026-09-28 16:39:10
AI-Translated & Reviewed
A balancing method is an algorithm used by Application Load Balancer (ALB) to distribute traffic to target groups. Different balancing methods can achieve different balancing effects.

WRR

The weighted round robin (WRR) algorithm schedules different servers in a round-robin and sequential manner. This algorithm addresses performance disparities among servers by using corresponding weights to represent their processing capabilities. It distributes requests to each server based on the weight values and the round-robin method. The WRR algorithm schedules requests based on the number of new connections. Servers with higher weight values are assigned connections first. The higher the weight value, the more frequently (or with higher probability) a server is polled. Servers with the same weight value process the same number of connections.
Advantages: Simple and practical. It does not need to record the statuses of all current connections and is a stateless scheduling method.
Disadvantages: Relatively simple. It is easy to cause load imbalance among servers when the request service time varies greatly or the time consumed by each request is inconsistent.
Scenarios: The load situation is optimal when each request takes roughly the same amount of time to reach the backend. It is commonly used for non-persistent connection services, such as HTTP.
User recommendation: If you know that the time each request takes to complete the task is roughly the same and the types of requests processed by the real servers are the same or similar, we recommend that you choose the WRR method. When the request time difference is small, it is also recommended that you use the WRR method, because this implementation method consumes little energy, does not require traversal, and is more efficient.

WLC

In practice, the time a client's request service stays on a server varies significantly. As the operating time extends, using simple round-robin or random load balancing algorithms may result in a vastly different number of connection processes on each server, failing to achieve true load balancing. Least connections scheduling is a dynamic scheduling algorithm. Unlike round-robin scheduling, it estimates a server's load based on its current number of active connections. The scheduler needs to record the number of established connections for each server. When a request is scheduled to a server, its number of connections is incremented by one. When a connection terminates or times out, its number of connections is decremented by one. The weighted least connections (WLC) scheduling algorithm is an improvement upon the least connections scheduling algorithm. Based on the different processing capabilities of servers, it assigns different weights to each server, enabling them to handle a number of service requests proportional to their weight.
Note:
Assume that the weight of each real server is wi and its current number of connections is ci. Calculate the ratio ci/wi for each server. The real server instance with the smallest ci/wi value is selected as the next instance to be assigned. If real server instances with the same ci/wi value exist, the WRR scheduling method is used for scheduling.
Advantages: It is suitable for long-time processing request services, such as FTP and other applications.
Disadvantages: Due to API limits, the Least Connections and Session Persistence features cannot be enabled simultaneously at present.
Scenarios: It is suitable for scenarios where the backend time taken by each request varies greatly. It is commonly used in persistent connection services.
User recommendation: If you need to handle different requests and the backend time taken by these requests varies significantly, such as a magnitude difference between 3 ms and 3 s, it is recommended that you use the WLC algorithm to achieve load balancing.

Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback