Quickstart: Load balance IPv4 services with CLB
Deploying an application on a single server creates a single point of failure (SPOF) if the server fails or traffic exceeds its capacity. This reduces system availability and degrades the user experience.
Overview
You can use a Classic Load Balancer (CLB) instance to load balance IPv4 services in three steps:
Create an internet-facing CLB instance: An internet-facing CLB instance comes with a static public IP address. You do not need to associate an elastic IP address (EIP) with the CLB instance to provide services over the internet.
Configure a listener and a server group for the CLB instance:
A server group is a logical collection of backend servers that process requests distributed by a CLB instance.
A listener checks for connection requests from clients on a specific protocol and port and forwards the requests to the specified server group for processing.
Configure DNS resolution: A Classic Load Balancer (CLB) instance has a service address, which is its public IP address. In production, you point a domain name to this address so clients can access the service by its domain name.
The following figure shows the service architecture.
Prerequisites
You have created two Elastic Compute Service (ECS) instances: ECS01 and ECS02. The ECS instances must be in the same region as the CLB instance. For zonal high availability, we recommend creating the two ECS instances in different zones.
You have completed domain name registration. If your domain name accesses an Alibaba Cloud server in mainland China, you must also complete an ICP filing.
Procedure
Step 1: Create an internet-facing CLB instance
Log on to the Classic Load Balancer (CLB) console. In the top navigation bar, select the region where you want to create the instance.
Click Create CLB. On the buy page, select the region and zone for the CLB instance and configure an instance name.
Complete the payment to create the instance. The new instance appears in the Classic Load Balancer (CLB) console.
Step 2: Configure a listener and a server group
On the Instances page, find the target instance and click Configure Listener in the Actions column.
Configure the listener protocol and listener port.

Configure a server group and add backend servers.

Select the servers that you want to add as backend servers for the CLB instance.

Configure the application port for the backend servers and add them to the server group.

We recommend that you use the default health check settings.

Review the configurations and submit them.

Step 3: Configure DNS resolution
On the Instances page, find the target instance and copy the IP address from the IP Address column.
Add an A record to map your domain name to the CLB instance's service address.
Log on to the Alibaba Cloud DNS console, find the target domain name, and click Settings in the Actions column.
Click Add Record, configure the record type, hostname, and record value, and keep the default values for other parameters.
Record Type: Select A to map a domain name to an IPv4 address.
Hostname: The prefix of the domain name.
Record Value: The service address of the CLB instance.
Verification
Use a client that can access the internet.
In a browser, enter the domain name and refresh the page several times. You can see that requests alternate between ECS01 and ECS02.
If the port that you configured is not the default port of the listener protocol, you must enter the full address, including the protocol, domain name, and port. Example: http://www.example.com:9000.


Stop one of the ECS instances. Client requests are still processed normally. This demonstrates that the load balancer ensures service availability even if a backend server fails.
More operations
Delete resources
If you no longer need the resources after your test, delete them to avoid incurring fees.
Delete the DNS record: Log on to the Alibaba Cloud DNS console and click the target domain name. Find the target DNS record and click Delete in the Actions column to delete the record.
Delete the CLB instance: Log on to the Classic Load Balancer (CLB) console. In the Actions column of the target instance, choose
> Release Settings, and then release the instance.Delete the ECS instances and security group:
Log on to the Elastic Compute Service (ECS) console. In the top navigation bar, select the region where the instances are deployed. Find the target instance, click
in the Actions column, select Release in the pop-up window, and then release the instance.Log on to the Security Groups page of the ECS console. In the top navigation bar, select the region where the security group is deployed, find the target security group, and click Delete in the Actions column.
Delete the VPC and related resources: Log on to the Virtual Private Cloud (VPC) console. In the top navigation bar, select the region where the instance is deployed. Click Delete in the Actions column of the VPC instance to delete the VPC, vSwitches, and other network resources.
FAQ
Internet-facing and internal-facing CLB instances
Feature | Internet-facing CLB instance | Internal-facing CLB instance |
Internet accessibility | An Internet-facing Classic Load Balancer (CLB) instance is provisioned with a static public IP address that is tightly bound to the instance. When you release an instance, you can choose to convert its public IP address into an Elastic IP Address (EIP) and retain it. | An internal-facing CLB instance is deployed in a VPC and does not provide internet access by default. You can associate an elastic IP address (EIP) with an internal-facing CLB instance to enable internet access. You can associate an EIP with or disassociate an EIP from a CLB instance at any time. |
Service address | Provides only a public IP address. | Provides a private IP address within a VPC. If an EIP is associated, the instance also provides the public IP address of the EIP. |
Network capability | Can add backend servers (ECS instances and ENIs) from different VPCs. | Can only add backend servers (ECS instances and ENIs) from the same VPC. |
After an instance is created, you cannot change its network type (Internet-facing or internal-facing).
Billing methods
Billing method | Instance metering method | Instance network type | Internet data transfer metering method | Use cases |
Pay-by-LCU | Internet-facing | Pay-by-data-transfer |
| |
Internal | N/A | |||
Pay-by-specification (sale discontinued) | Internet-facing | Pay-by-data-transfer |
| |
Pay-by-bandwidth | ||||
Internal | N/A |
Instance specifications
Starting June 1, 2025, 00:00:00 (UTC+8), pay-by-specification CLB instances are no longer available for purchase. For more details, see End of sale for pay-by-specification CLB instances.
Different instance specifications provide different levels of performance. Key metrics include maximum connections, connections per second (CPS), and queries per second (QPS). For more information, see Instance specifications.
Inbound and outbound bandwidth
Yes. The configured bandwidth limit applies to both inbound and outbound traffic.
VPC migration
No.
To switch to another VPC, you must create a new CLB instance in that VPC.
Non-Alibaba Cloud backend servers
No. CLB instances support only Alibaba Cloud Elastic Compute Service (ECS) instances, elastic network interfaces (ENIs), and Elastic Container Instance (ECI) instances as backend servers.
Cross-account backend servers
No. You can only add backend servers from your own Alibaba Cloud account.
EIP association with multiple resources
No. An EIP can be associated with only one cloud resource at a time.
References
For an overview of the use cases and components of CLB, see What is Classic Load Balancer (CLB)?.
Learn about the features of CLB, see Features.
For the regions where CLB is available, see Regions and zones.
For details on how CLB is billed, see CLB billing overview.

