This topic describes how to use Global Accelerator (GA) to accelerate connections to origin servers by using domain names of the servers.

Background information

The scenario in the following figure is used as an example. A company is headquartered in the US (Silicon Valley) region, where a web service is deployed on two origin servers on the premises. The web service can be accessed through the domain name www.example.com on port 80. When users from the office in the China (Hong Kong) region connect to the web service deployed in the US (Silicon Valley) region over the Internet, the network performance is unstable. The unstable network connection may cause issues such as latency, network jitter, and packet loss.
Accelerate transmission of network traffic destined for a specified domain nameTo accelerate connections to the origin servers, you can create a GA instance that provides an access point in the China (Hong Kong) region. When users in the China (Hong Kong) region send requests to the servers, the access point in the China (Hong Kong) region receives the requests and forwards the requests to the endpoints in the US (Silicon Valley) region through intelligent routing. Therefore, GA can improve user experience.

Procedure

Procedure

Step 1: Enter the required information about the web service that you want to accelerate

You can enter the required information about the accelerated web service in the GA console. The system recommends the GA instance and basic bandwidth plan based on your business requirements.

  1. Log on to the Global Accelerator console.
  2. In the upper-right corner of the Instances page, click Purchase Guide.
    Note Skip the step if it is your first time using GA.
    Purchase Guide
  3. In the Enter the required information to generate a list of recommended services section, enter the required information.
    • Acceleration Region: Select the region that requires acceleration. In this example, China (Hong Kong) is selected.
    • Service Region: Select the region where the origin servers are located. In this example, US (Silicon Valley) is selected.
    • ICP Filing: If you need to accelerate a web service, select Yes. If the service is not a web service, select No. In this example, No is selected.
      Note All websites must obtain an ICP number before they are permitted to provide services to users in mainland China. For more information, see What is an ICP filing?.
    • Server Area: Specify whether the backend servers are deployed on Alibaba Cloud. Off Alibaba Cloud is selected in this example.
    • Peak Bandwidth Range: Enter the bandwidth required during peak hours. Unit: Mbit/s. The value is set to 10 in this example.
    • Maximum Concurrent Connections: Specify the maximum number of concurrent connections that the GA instance supports. When the number of existing concurrent connections reaches the upper limit, new connection requests are dropped. The value is set to 5 thousand in this example.
  4. Click Generate Service List.
    After a service list is generated, you can view the list of recommended services. Recommended service list

Step 2: Purchase a GA service bundle

You can purchase a GA service bundle that includes the recommended GA instance and basic bandwidth plan.

  1. Click Generate Service List.
    Generate Service List
  2. On the buy page, set the following parameters:
    • Term: Select a subscription duration.
      Note The subscription duration applies to the services in the recommended service bundle. For example, if you set Term to 1 Year,the subscription duration of the specified GA instance, basic bandwidth plan, and cross-border bandwidth plan is set to one year.
    • Specification: Select a specification for the GA instance that you want to create. Small I (Specification Unit) is selected in this example.
    • Bandwidth Type: Select the type of the basic bandwidth plan. Premium is selected in this example.
  3. Click Buy Now to complete the payment.
  4. After you complete the payment, associate the basic bandwidth plan with the GA instance. For more information, see Bind a basic bandwidth plan.

Step 3: Add an area to be accelerated

After you purchase a GA instance, you can add one or more areas where users are located, and allocate bandwidth resources to these areas.

  1. On the Instances page, find the GA instance and click its ID.
  2. Click the Acceleration Area tab, and click Add Region on the Asia Pacific tab.
  3. In the Add Acceleration Area dialog box, set the following parameters:
    • Regions: Select the region where users are located. In this example, China (Hong Kong) is selected.
    • Bandwidth: Select a bandwidth value for the acceleration service. The value is set to 10 Mbit/s in this example.
    • Internet Protocol: Select the IP version that is used to connect the clients to GA. IPv4 is selected in this example.
  4. Click OK.
    After you add a region, the system assigns an accelerated IP address to the region that is added to the GA instance. This accelerated IP address is used to forward requests from users in the specified region to the specified origin server through GA and accelerate connections to the origin server. Accelerated IP address

Step 4: Add a listener

Listeners are used to monitor connection requests from clients. GA monitors connection requests received on the specified listener ports and forwards the requests to endpoints through the specified protocol.

  1. On the instance details page, click the Listeners tab and then click Add Listener.
  2. In the Configure Listener & Protocol wizard, set the following parameters for the listener:
    Listener
    Parameter Description
    Listener Name Enter a name for the listener.

    The name must be 2 to 128 characters in length, and can contain letters, digits, underscores (_), and hyphens (-). The name must start with a letter.

    Protocol Select the protocol of the listener.

    In this example, TCP is selected.

    Port Number Specify a port for the listener. The port is used to receive and forward requests to endpoints. Valid values: 1 to 65499.

    The value is set to 80 in this example.

    Client Affinity Specify whether to enable client affinity. If client affinity is enabled, requests from the same client can be directed to the same endpoint when the client accesses a stateful application.

    In this example, Source IP Address is selected.

  3. Click Next to configure an endpoint group.

Step 5: Configure an endpoint group

Each listener is associated with an endpoint group. You can associate an endpoint group with a listener by specifying the regions to which you want to distribute network traffic. After you associate an endpoint group with a listener, traffic is distributed to the optimal endpoint in the associated endpoint group.

  1. On the Configure Endpoint Group wizard page, set the following parameters for the endpoint group:
    Endpoint configuration
    Parameter Description
    Endpoint Group Name Enter a name for the endpoint group.

    The name must be 2 to 128 characters in length, and can contain letters, digits, underscores (_), and hyphens (-). The name must start with a letter.

    Region Select the region to which the endpoint group and backend servers belong.

    In this example, US (Silicon Valley) is selected.

    Backend Service Specify whether the backend servers are deployed on Alibaba Cloud.

    Off Alibaba Cloud is selected in this example.

    Reserve Client IP Specify whether to reserve client IP addresses. After the feature is enabled, backend servers can obtain source IP addresses of clients.

    This feature is disabled in this topic.

    Note This feature is available to only Alibaba Cloud accounts that are included in the whitelist. To use this feature,submit a ticket.
    Endpoint An endpoint serves as the destination that a client requests to access. Set the following parameters to configure an endpoint:
    • Backend Service Type: Select Custom Domain Name from the drop-down list.
    • Backend Service: Enter the custom domain name that you want to accelerate.
    • Weight: Enter a weight for the endpoint. Valid values: 0 to 255. GA routes network traffic to each endpoint based on the weights.
      Notice If you set the weight of an endpoint to 0, GA does not route network traffic to the endpoint. Proceed with caution.
  2. Click Next, confirm the configurations of the listener and endpoint, and then click Submit.

Step 6: Configure a CNAME record

To enable the acceleration service based on the CNAME assigned to your GA instance, you must configure a CNAME record to map your accelerated domain name to the CNAME.

  1. Log on to the Alibaba Cloud DNS console.
  2. On the Manage DNS page, find the domain name and click Configure in the Actions column to go to the DNS Settings page.
  3. Click Add Record and set the following parameters:
    1. Type: Select CNAME from the drop-down list.
    2. Host: Enter the prefix of the accelerated domain name.
      • If the accelerated domain name is testcdn.aliyun.com, set the prefix to testcdn.
      • If the accelerated domain name is www.aliyun.com, set the prefix to www.
      • If the accelerated domain name is aliyun.com, set the prefix to @.
      • If the accelerated domain name is *.aliyun.com, set the prefix to *.
    3. ISP Line: Select Default from the drop-down list.
    4. Value: Enter the CNAME value that is allocated to your GA instance. You can find the value on the Instances page next to the Instance ID/Name of the instance.
      CNAME
    5. TTL: Select 10 minute(s).
    6. Click OK.
    Note
    • A new CNAME record immediately takes effect. If you modify the CNAME record, the record takes effect within 72 hours after it is modified.
    • After you add a CNAME record, it takes about 10 minutes for the system to update the status in the console. If the message "You must add the CNAME record" appears on the Domain Names page, ignore this message.

Step 7: Test the acceleration performance

Note If you specify UDP as the protocol when you add a listener, you can test the acceleration performance by using UDPing. For more information, see Test the acceleration of UDP traffic.
  1. Open the command-line interface of an on-premises device. In this example, the device is located in the China (Hong Kong) region.
  2. Run the following command to query the network latency:
    curl -o /dev/null -s -w "time_connect: %{time_connect}\ntime_starttransfer: %{time_starttransfer}\ntime_total: %{time_total}\n" ""http[s]://<Domain name of endpoint>[:<Port>]""
    where:
    • time_connect: the period of time that it takes to establish a TCP connection.
    • time_starttransfer: the start time of data transfer. It refers to the time that it takes for the backend server to send the first byte after the client sends a request.
    • time_total: the total connection time. It refers to the time that it takes for the backend server to respond after the client sends a request.
    The test result shows that GA has reduced the network latency when clients in the China (Hong Kong) region access web services in the US (Silicon Valley) region.
    Figure 1. The network latency of data transmission before GA is used
    The network latency of data transmission before GA is used
    Figure 2. The network latency of data transmission after GA is used
    The network latency of data transmission after GA is used