tencent cloud

Application Load Balancer

Getting Started

Download
Focus Mode
Font Size
Last updated: 2026-09-28 16:39:09
AI-Translated
Application Load Balancer (ALB) is an application-layer load balancing service launched by Tencent Cloud. It supports HTTP and HTTPS protocols and provides flexible forwarding capabilities based on domain names and URL paths. This document guides you through quickly creating an ALB instance and forwarding client access requests to a backend target group.

Prerequisites

1. The Cloud Virtual Machine (CVM) instances have been created, and web services have been deployed on them. This document uses the following 2 instances as an example: rs-1 and rs-2. For details about how to create a CVM instance, see Purchasing and Starting a CVM Instance.
2. The backend services have been deployed on the CVM instances. This document uses HTTP forwarding as an example. Nginx servers have been deployed on two CVM instances. For details, see Deploying Nginx on CentOS.
3. If you want to access the service via a domain name, make sure that you have registered a domain name and completed Internet Content Provider (ICP) filing. For details about domain name registration, go to the Tencent Cloud domain name registration page.

Operation Steps

Step 1: Creating a Target Group

A target group is used to route client requests to one or more backend services. When using ALB, you need to create a target group and add backend services to receive forwarded requests.
1. Log in to the ALB console.
2. In the left sidebar, choose ALB > Target Group Management.
3. On the ALB target group management page, click Create.
4. In the displayed Create Target Group dialog box, configure the following parameters:
Parameter
Description
Target Group Type
Select the type of the backend service that the target group carries. Currently, only instances are supported.
Target Group Name
Enter a target group name, which is used for identification and management in a convenient manner. It can contain up to 60 characters.
VPC
Select the VPC to which the target group belongs. The backend services added to a target group must belong to the same virtual private cloud (VPC). If the existing network is not suitable, click Create VPC to create one.
Backend Protocol
Select the protocol between ALB and backend services. HTTP, HTTPS, gRPC, and gRPCs are supported. This document uses HTTP as an example.
Balancing Method
Select a traffic distribution algorithm for multiple backend services within a target group. The following two methods are supported: weighted round robin (WRR) and weighted least connections (WLC).
Session Persistence
After it is enabled, ALB distributes requests from the same client to the same backend service.
Note:
If WLC is selected for Balancing Method, requests are scheduled based on the service load and weight in the target group. In this case, requests from the same client may not be distributed to the same backend service, and session persistence is not supported.
Persistent Connection
After it is enabled, the number of connections between ALB and backend services fluctuates within the range of [QPS, QPS x 60]. The specific value depends on the connection reuse rate. If a limit is imposed on the number of connections to backend services, proceed with caution.
Tag
You can select a tag key and a tag value or add a tag. For details, see Creating a Tag.
5. Configure the health check. The parameters and their descriptions are as follows:
Parameter
Description
Health Check
After it is enabled, ALB automatically checks for and removes abnormal backend services.
Check Method
TCP, HTTP, and HTTPS check methods are supported.
Check Port
By default, the real server port is used. If no special requirements exist, we recommend that you leave it empty.
Advanced Configuration
The default settings are retained in this document. You can click Modify to modify them. For details, see Configuring a Health Check.
6. Click Finish.
7. After creation, access the newly created target group in the ALB target group management list. Switch to the Instances in Target Group tab, select the backend services to be bound, set a port and weight, and click OK. This document uses backend services rs-1 and rs-2 as examples.

Step 2: Creating an ALB Instance

An ALB instance is the basic running unit of the load balancing service. After an instance is created, the system assigns a service address, consisting of a virtual IP address (VIP) and domain name, to it for receiving client requests.
1. In the left sidebar, choose ALB > Instance Management and click Create.
2. On the purchase page, complete the configuration based on your business needs. For details, see Creating an ALB Instance.
3. Confirm configuration information and fees and click Buy Now.
4. Return to the ALB console, choose ALB > Instance Management in the left sidebar, and select the corresponding region to view the newly created ALB instance.

Step 3: Configuring a Listener and Forwarding Rule

A listener listens for client requests and receives traffic via specified protocols and ports. A forwarding rule defines how traffic is distributed to a backend target group. This step details how to create an HTTP listener and configure a forwarding rule to route requests to the target group created in Step 1.

Configuring an HTTP Listener

1. In the left sidebar, choose ALB > Instance Management and click the instance ID.
2. Switch to the Listener Management tab, click Create Listener, and configure the following parameters:
Parameter
Description
Listening Protocol
Select the protocol type for listening. In this document, HTTP is used.
Name
Enter a value. It cannot exceed 255 characters.
Listener Port
Enter the listening port that can be used to receive and forward requests from and to a backend service. Value range: 1–65535.
Tag
You can select a tag key and a tag value or add a tag. For details, see Creating a Tag.
Advanced Configuration
Retain the default settings in this document. To modify them, you can click Modify. For details, see Creating and Managing a Listener.
3. Click Next: Configure Forwarding Action to configure the default forwarding action for the listener.
4. Select the target group created in Step 1 and click Confirm.

Configuring a Forwarding Rule

1. On the listener management page, click the listener ID to go to the details page of the newly created HTTP listener.
2. Switch to the forwarding rule tab, click Create Forwarding Rule, and configure the following parameters:
Parameter
Description
Rule Name
Name of the forwarding rule, which can contain up to 255 characters. Characters such as digits, letters, Chinese characters, hyphens, underscores, and periods are supported. If it is left empty, the system automatically generates one.
Forwarding Condition
Forwarding condition. The domain name, path, HTTP Header, Query String, HTTP request method, Cookie, and SourceIp conditions are supported. Traffic is forwarded only when all configured conditions are met. For details, see Configuring a Forwarding Rule.
Forwarding Action
Actions such as forwarding to, redirecting to, returning a fixed response, rewriting, writing a header, and deleting a header are supported. When forwarding conditions are met, one or more configured forwarding actions are executed. For details, see Configuring a Forwarding Rule.
Priority
Order in which rules take effect within a listener rule set. The value range is 1–10000, and the priority must be unique.
3. Click OK.

Step 4: Setting Domain Name Resolution

You need to resolve your own domain name to the service domain name of the ALB instance by using a CNAME record.
1. In the left sidebar, choose ALB > Instance Management to obtain the domain name of the ALB instance created in Step 2.
2. Log in to the DNS console. On the domain name resolution list page, click Resolve in the Operation column to the right of the target domain name.
3. On the record management tab, click Add Record.
4. Click Add Record and configure the following parameters:
Parameter
Description
Host Record
Domain name prefix. For details, see Subdomain Name Description and Wildcard Resolution Description.
Record Type
CNAME is recommended.
Line Type
A default type is recommended. Otherwise, some users may experience resolution failures.
Record Value
The CNAME record value, which can be filled in as the ALB instance domain name.
Weight
The specified weight ratio. Multiple records under the same line are returned based on it.
TTL
The DNS time‑to‑live value, in seconds.
5. Click OK.
6. About 10 minutes after the resolution record is added, enter http://<domain_name> in your browser. Refresh the page multiple times and check whether the response alternates between rs‑1 and rs‑2 to verify that load balancing takes effect.


Help and Support

Was this page helpful?

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

Feedback