All Products
Search
Document Center

Global Accelerator:Use GA traffic distribution to switch traffic across regions

Last Updated:Apr 02, 2026

Use the traffic distribution feature to gradually shift client traffic from one endpoint group to another — without dropping existing connections.

How it works

Global Accelerator (GA) provides two independent controls for traffic:

  • Traffic distribution ratio — the percentage of traffic directed to an endpoint group. Set at the endpoint group level. Valid values: 0–100. The default is 100.

  • Endpoint weight — how traffic is distributed among endpoints within a single endpoint group. Valid values: 0–255. The default is 255.

When multiple endpoint groups are under one listener, GA also applies scheduling priority: the endpoint group with lower network latency (determined by proximity to the access point) gets higher priority and receives traffic first.

The final traffic distribution depends on both the ratio and the scheduling priority of each endpoint group.

Key behaviors:

  • The ratio controls what percentage of traffic is forwarded to an endpoint group. Setting the ratio to 0% stops all traffic to that endpoint group; setting it to 100% sends all eligible traffic to it. When you reduce the ratio of the higher-priority endpoint group, traffic is redistributed to other endpoint groups according to their ratios and scheduling priorities.

  • If health checks are enabled and a higher-priority endpoint group fails, all traffic moves to the next available endpoint group — the configured ratio is ignored until recovery.

  • If a forwarding rule exists, traffic is scheduled among the endpoint groups associated with the matched forwarding rule.

For the subscription billing method, only TCP and UDP listeners support traffic distribution. For the pay-as-you-go billing method, all listener types support traffic distribution.

Use cases

Scenario Description
Regional migration Shift traffic from one region to another in stages (100% → 50% → 0%) to validate the new region before cutting over.

This tutorial walks through a regional migration scenario.

Scenario

A company runs a service on servers in the China (Beijing) and China (Shanghai) regions. The TCP protocol is used on port 80, and clients are in the China (Beijing) region.

By default, GA sends all client requests to the endpoint group in China (Beijing). China (Shanghai) acts as the secondary endpoint group. The company wants to migrate traffic to China (Shanghai) while keeping the service available throughout the switchover.

The migration uses three stages:

Stage Beijing ratio Shanghai ratio Expected result
Baseline 100% 100% All traffic goes to Beijing (higher scheduling priority)
Validate 50% 100% Traffic splits roughly 50/50 between regions
Cut over 0% 100% All traffic goes to Shanghai
image

Prerequisites

Before you begin, ensure that you have:

  • Two servers deployed — one in China (Beijing) and one in China (Shanghai) — both running on TCP, port 80

  • An Alibaba Cloud account with permission to create GA instances

  • (Optional) Activated the pay-as-you-go GA service at Activate the Service if this is your first time using pay-as-you-go GA instances

This tutorial uses a pay-as-you-go standard GA instance. Pay-as-you-go instances use the pay-by-data-transfer metering method. No basic bandwidth plan is required — data transfer billing is managed by Cloud Data Transfer (CDT). For billing details, see Pay-by-data-transfer and Billing of pay-as-you-go GA instances.

Step 1: Deploy and verify servers

The servers in this example run Alibaba Cloud Linux 3.2104 (64-bit). Commands may vary depending on your operating system.

  1. Deploy servers in China (Beijing) and China (Shanghai). Open port 80 on TCP for both servers.

  2. From a client in China (Beijing), run the following command to confirm that both servers are reachable:

    curl <Origin server IP address>

    Each server returns its region information. Confirm that both servers respond correctly before continuing. Figure 1. Response from the China (Beijing) server 访问北京服务器 Figure 2. Response from the China (Shanghai) server 访问上海服务器

Step 2: Create a GA instance

image
  1. Log on to the GA console.

  2. On the Instances page, click Create Standard Pay-as-you-go Instance.

  3. In the Basic Instance Configuration step, set the following parameters 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.
    Resource Group Select the resource group for this instance. The resource group must be created by the current Alibaba Cloud account in Resource Management. See Create a resource group.

Step 3: Configure an acceleration area

Specify the acceleration area and allocate bandwidth.

In the Configure Acceleration Area step, set the following parameters and click Next.

Parameter Value in this example Description
Acceleration Area China (Beijing) (under North China) Select one or more regions and click Add.
Maximum Bandwidth 200 Mbit/s The bandwidth cap for the acceleration area. Each area supports 2–10,000 Mbit/s. Data transfer fees are managed by CDT.
IP Protocol IPv4 The IP version used to connect to GA.
ISP Line Type BGP (Multi-ISP) The line type for the GA instance.
Important

Setting the maximum bandwidth too low can cause throttling and packet drops. Set the maximum bandwidth based on your expected traffic volume.

Step 4: Configure a listener

A listener receives connection requests and routes them to endpoint groups based on the port and protocol you specify.

In the Configure listeners step, set the following parameters and click Next. For parameters not listed here, keep the defaults. For full parameter descriptions, see TCP or UDP listener.

Parameter Value in this example Description
Listener Name (your choice) Enter a name for the listener.
Routing Type Intelligent Routing The routing type for the listener.
Protocol TCP The listener protocol.
Port 80 The port that receives and forwards requests. Valid values: 1–65499.

Step 5: Configure endpoint groups

Add the China (Beijing) endpoint group

  1. In the Configure an endpoint group step, set the following parameters and click Next. For parameters not listed here, keep the defaults. For full parameter descriptions, see Configure the endpoint groups of intelligent routing listeners.

    Parameter Value in this example Description
    Region China (Beijing) The region where the endpoint group is created.
    Backend Service Type Custom Public IP The type of backend service to accelerate.
    Backend Service Public IP of the Beijing server The IP address of the backend service.
    Weight 255 (default) Controls traffic distribution within the endpoint group. Valid values: 0–255. If set to 0, GA stops sending traffic to that endpoint.
    Preserve Client IP Do Not Preserve (default) Whether to pass client IP addresses to the backend server.
    Traffic Distribution Ratio 100 (default) The percentage of traffic directed to this endpoint group. Valid values: 0–100.
    Health Check Enabled Monitors endpoint availability.
    Health Check Protocol TCP The protocol used for health checks. Supported values: TCP, HTTP, HTTPS.
    Port 80 The endpoint port to which health check probes are sent. Valid values: 1–65535.
  2. In the Configuration Review step, confirm the listener and endpoint configurations, then click Submit.

    It takes 3–5 minutes to create a GA instance.
  3. (Optional) After the instance is created, click Go To Instance Details to review the configuration on the Instance Information, Listeners, and Acceleration Areas tabs.

Add the China (Shanghai) endpoint group

  1. On the instance details page, click the Listeners tab.

  2. Find the listener you created and click the endpoint group ID or number in the Default Endpoint Group column.

  3. In the Default Endpoint Group section on the Endpoint Group tab, click + Add Endpoint Group.

  4. On the Add Endpoint Group page, set the following parameters and click Create: Keep all other parameters the same as the China (Beijing) endpoint group.

    • Region: China (Shanghai)

    • Backend Service (under Endpoint Configuration): Enter the public IP address of the Shanghai server.

Step 6: Test traffic distribution

Use the following command to simulate client requests and measure how traffic is distributed between regions:

echo > curl.txt; for ((i=0;i<<Number of requests>;i++)); do curl -s <Accelerated IP address> >> curl.txt; done; beijing_count=`grep Beijing curl.txt | wc -l`;echo "Beijing count: ${beijing_count}";shanghai_count=`grep Shanghai curl.txt | wc -l`;echo "shanghai count: ${shanghai_count}";

Replace the placeholders before running:

Placeholder Description Example
<Number of requests> The number of requests to send 100
<Accelerated IP address> The accelerated IP address assigned by GA 47.xxx.xxx.xxx

The command counts responses from Beijing (Beijing count) and Shanghai (shanghai count).

Stage 1: Baseline (Beijing ratio = 100%)

Run the command from a client in China (Beijing) with 100 requests.

测试流量调配100

All 100 requests are handled by the China (Beijing) endpoint group. Because Beijing has higher scheduling priority for clients in that region and the ratio is 100%, no traffic reaches Shanghai.

Stage 2: Validate the new region (Beijing ratio = 50%)

  1. Change the traffic distribution ratio to 50% for the China (Beijing) endpoint group. See Set the traffic distribution ratio for an endpoint group.

  2. Run the test again with 100 requests. Each endpoint group handles approximately 50 requests. Verify that the service behaves correctly on the Shanghai servers before proceeding.

    测试流量调配50

Stage 3: Complete the cutover (Beijing ratio = 0%)

  1. Change the traffic distribution ratio to 0% for the China (Beijing) endpoint group. See Set the traffic distribution ratio for an endpoint group.

  2. Run the test again with 100 requests. All 100 requests are now handled by the China (Shanghai) endpoint group. The migration is complete.

    测试流量调配0

What's next