Global Accelerator (GA) accelerates these applications to provide multi-region load balancing and high availability disaster recovery.
Background
A financial company has its headquarters in the US (Silicon Valley) region and a branch office in the US (Virginia) region. It has deployed applications on ECS instances ECS01 and ECS02 in the corresponding Alibaba Cloud regions. The company's clients are primarily located in the China (Hong Kong) and Japan (Tokyo) regions. To ensure the continuous operation of its critical applications and minimize potential losses from service disruptions, the company has the following reliability requirements:
-
If an incident occurs at the US (Silicon Valley) headquarters, traffic must quickly fail over to the branch office system in the US (Virginia) region.
-
Reduce issues such as latency, jitter, and packet loss caused by unstable public network connections across regions.
You can create a Global Accelerator instance and set Japan (Tokyo) and China (Hong Kong) as acceleration areas. Then, you can add your application servers in the US (Silicon Valley) and US (Virginia) regions as endpoint group 1 and endpoint group 2, respectively. Global Accelerator intelligently distributes traffic based on the scheduling priority and traffic distribution settings for each endpoint group to achieve multi-region load balancing.
You can configure a health check for each endpoint group. If the headquarters' system fails its health check, Global Accelerator automatically routes new requests to the healthy branch system. When the headquarters' system becomes healthy again, Global Accelerator automatically resumes routing traffic to it. This architecture provides high availability for your cross-region applications and reduces network latency.
Additionally, you can use the CNAME provided by the Global Accelerator instance to configure your DNS settings. The Global Accelerator CNAME address uses region-based resolution to return the optimal accelerated IP address to end users in different regions. This reduces DNS resolution latency and improves application access speed.
Prerequisites
-
You have deployed backend applications on your ECS instances: ECS01 in the US (Silicon Valley) region and ECS02 in the US (Virginia) region.
-
You have configured A records in your DNS settings to point your application's domain name to the public IP addresses of both backend servers.
This topic's example uses Nginx to configure a backend HTTP service on port 80 and Alibaba Cloud DNS to configure DNS records.
If you use a DNS provider other than Alibaba Cloud DNS, follow your provider's instructions.
Step 1: Configure basic information about an instance
Log on to the GA console.
On the Instances page, click Create Standard Pay-as-you-go Instance.
In the Basic Instance Configuration step, configure the parameters based on the following table and click Next.
Parameter
Description
GA Instance Name
Enter a name for the GA instance.
Instance Billing Method
Pay-As-You-Go is selected by default.
You are charged instance fees, Capacity Unit (CU) fees, and data transfer fees for pay-as-you-go standard Global Accelerator instances.
For more information about instance fees and CU fees, see Pay-as-you-go Global Accelerator instance billing.
For more information about data transfer fees, see Data transfer billing.
Resource Group
Select the resource group to which the standard Global Accelerator instance belongs.
The resource group must be created by the current Alibaba Cloud account in Resource Management. For more information, see Create a resource group.
Step 2: Configure acceleration areas
Specify acceleration regions and allocate bandwidth to each acceleration region.
In the Configure Acceleration Area step, configure the parameters based on the following table and click Next.
|
Parameter |
Description |
|
Acceleration Area |
From the drop-down list, select the regions to accelerate, and then click Add To List. In this example, select China (Hong Kong) and Japan (Tokyo). |
|
Assign Bandwidth |
|
|
Maximum Bandwidth |
Set the bandwidth for the acceleration area. The bandwidth for each acceleration area can range from 2 to 10,000 Mbps. This value is a rate limit. CDT bills the resulting data transfer costs. In this example, keep the default value of 200 Mbps. Important
Ensure the value meets your business requirements. If the maximum bandwidth is set too low, traffic may be dropped due to rate limiting. |
|
IP Protocol |
Select the IP address protocol for the Global Accelerator service. In this example, keep the default value IPv4. |
|
ISP Line Type |
Select the ISP line type for the Global Accelerator service. In this example, select BGP (Multi-ISP). |
Step 3: Configure a listener
A listener listens for connection requests and distributes the requests to endpoints based on the port and the protocol that you specify. Each listener is associated with an endpoint group. You can associate an endpoint group with a listener by specifying the region to which you want to distribute network traffic. After you associate an endpoint group with a listener, network traffic is distributed to the optimal endpoint in the endpoint group.
In the Configure Listeners step, configure a listener and click Next.
This section describes only the parameters relevant to this example. You can keep the default values for the other parameters. For more information, see Add a TCP or UDP listener.
|
Parameter |
Description |
|
Listener Name |
Enter a name for the listener. |
|
Routing Type |
Select the routing type. In this example, select smart routing. |
|
Protocol |
Select the protocol for the listener. In this example, select TCP. |
|
Port |
Specify the listener port that is used to receive and forward requests to endpoints. The port number must be in the range of 1 to 65499. In this example, enter 80. |
Step 4: Configure endpoint groups and endpoints
You can configure two endpoint groups, one for the US (Silicon Valley) region and one for the US (Virginia) region, to host the endpoints for your backend applications. You can also configure health checks for both endpoint groups to achieve high availability for your cross-region applications.
By adjusting the traffic distribution settings, you can control the proportion of traffic that is routed to each endpoint group, allowing for balanced workloads.
-
Configure endpoint group 1 for the US (Silicon Valley) region.
-
On the Configure an Endpoint Group page, configure endpoint group 1 with the following information, and then click Next.
Parameter
Description
Region
Select the region where the endpoint group is located. This is the region of the origin servers that will handle user requests.
In this example, select US (Silicon Valley).
NoteIf you configure multiple endpoint groups, each group must be in a unique region. Only one endpoint group can be configured per region.
Endpoint Configuration
An endpoint is a specific resource, such as a server, that handles client requests. Configure the endpoint with the following information:
-
Backend Service Type: Select Alibaba Cloud Public IP.
ImportantHealth checks are supported for endpoints of the following types: ECS instances in a VPC, Alibaba Cloud public IPs, custom IPs, or custom domain names. If the endpoint type is a Server Load Balancer instance, the health check parameters configured for the endpoint group do not take effect.
-
Backend Service: Enter the IP address of the backend service to be accelerated. In this example, enter the IP address of the ECS01 instance in the US (Silicon Valley) region.
-
Weight: Enter a weight for the endpoint. The value can be an integer from 0 to 255. Global Accelerator routes traffic to endpoints based on their relative weights. In this example, keep the default value 255.
WarningIf the weight of an endpoint is set to 0, Global Accelerator stops distributing traffic to that endpoint. Proceed with caution.
Preserve Client IP
Select whether to preserve the client's source IP address.
If you enable this feature, your backend servers can see the original IP address of the client. For more information, see Preserve client IP addresses.
In this example, keep the default selection Off.
Traffic Distribution Ratio
Set the percentage of traffic to direct to this endpoint group.
The value can be an integer from 0 to 100. In this example, enter 50.
NoteTo learn more about traffic distribution, see How traffic distribution for multiple endpoint groups works and its use cases and Use traffic distribution to smoothly switch traffic across regions.
Health Check
Enable or disable health checks. When enabled, health checks monitor the status of your endpoints.
In this example, enable health checks and keep the default settings for other parameters.
-
-
On the Configuration Review page, confirm the settings for the listener and endpoint group 1, and then click Submit.
NoteCreating a Global Accelerator instance can take 3 to 5 minutes.
-
Optional: After the instance is created, click Go to Instance Details at the bottom of the task details list. On the instance details page, you can review the configuration on the Instance Information, Listeners, and Acceleration Areas tabs.
-
-
Configure endpoint group 2 for the US (Virginia) region.
-
On the instance details page, click the Listeners tab.
-
On the Listener tab, find the listener you created, and in the Default Endpoint Group column, click the endpoint group ID.
-
On the Endpoint Group tab, in the Default Endpoint Group section, click + Add Endpoint Group.
-
On the Add Endpoint Group page, configure the following parameters and click Create.
-
Region: Select US (Virginia).
-
In the Endpoint Configuration section, for Backend Service, enter the IP address of the ECS02 instance in the US (Virginia) region.
Keep the other parameter settings the same as for endpoint group 1.
-
-
Step 5: Configure CNAME resolution
For production environments, use a custom domain name. By creating a CNAME record that points your domain to the CNAME of the Global Accelerator instance, you can route application traffic through Global Accelerator for acceleration.
In this scenario, if you already have an A record that points to your backend server, you can first add a CNAME record that points to GA for the China (Hong Kong) region to perform a test. After the test is successful, you can gradually expand to other regions, such as Japan, or exclusively use the CNAME record that points to GA.
On the Authoritative DNS Resolution page, find the domain name that you want to use and click DNS Settings in the Actions column.
NoteFor a domain name that is not registered with Alibaba Cloud, you must add the domain name to the Alibaba Cloud DNS console before you can configure DNS records.
On the DNS Settings page, click Add DNS Record, configure a CNAME record, and then click OK.
In this example, the Record Type parameter is set to CNAME, the Hostname parameter is set to www, the DNS Request Source parameter is set to Asia_Hong Kong, and the Record Value parameter is set to the CNAME of the GA instance. You can use the default values for other parameters or modify the parameters based on your business requirements. For more information, see Add DNS records.

-
Verify that the CNAME record has taken effect.
You can open a command-line window on a computer in the acceleration region and run the ping command to ping the accelerated domain name.
If the response resolves to a value consistent with the Global Accelerator CNAME, the CNAME record is effective.
Step 6: Test the solution
Perform the following tests to verify the acceleration and high availability disaster recovery capabilities of the cross-region application.
If you are using a different operating system, use the appropriate commands. The test commands in this topic are for the following operating systems.
-
Client operating system: Windows Server 2022.
-
Origin server operating system: Alibaba Cloud Linux 3.
Test high availability across endpoint groups
-
Simulate a failure in one of the endpoint groups by taking the US (Silicon Valley) origin server offline, and then observe the resulting access behavior.
-
Open a browser on computers located in the China (Hong Kong), Japan, and other regions.
-
Enter your application's domain name to access the application deployed in the US (Silicon Valley) and US (Virginia) regions.
The test results are as follows:
-
For users in the China (Hong Kong) region, requests are served by ECS02, the origin server in the US (Virginia) region.
-
For users in the Japan region, requests are also served by ECS02, the origin server in the US (Virginia) region.
-
-
-
After the US (Silicon Valley) origin server is restored, repeat the test to check the access results for users in the China (Hong Kong) and Japan regions.
-
For users in the China (Hong Kong) region, requests are now served by ECS01, the origin server in the US (Silicon Valley) region.
-
For users in the Japan region, requests are also served by ECS01, the origin server in the US (Silicon Valley) region.
The final resolution of client requests (that is, the responding endpoint group) depends on your specific configuration. When Global Accelerator is configured with multiple acceleration areas and endpoint groups, the final routing decision is based on factors such as scheduling priority and traffic distribution settings. For more information, see How traffic distribution for multiple endpoint groups works and its use cases.
Test acceleration performance
To test the acceleration performance, see Test the acceleration performance of GA.