Global Accelerator (GA) can interact with Alibaba Cloud CDN (CDN) to accelerate content retrieval from origin servers. GA uses high-bandwidth BGP lines and the global transmission network of Alibaba Cloud to accelerate content delivery. You can connect CDN to GA to accelerate the delivery of dynamic content on a global scale.

Background information

The following scenario is used as an example. A web service is deployed in the US (Silicon Valley) region. The origin servers provide web services through elastic IP addresses (EIPs) of Alibaba Cloud. The forwarding port is TCP port 80. Users are located in the China (Hong Kong) region. When clients in China (Hong Kong) access the web service in US (Silicon Valley), issues such as network latency, network jitter, and packet loss frequently occur due to unstable cross-border Internet connections. Scenario

You can deploy CDN to accelerate content delivery from your web service. CDN caches frequently requested content on CDN edge nodes to improve user experience. GA uses high-bandwidth BGP lines and the global transmission network of Alibaba Cloud to accelerate content delivery. You can set CDN to interact with GA to accelerate the delivery of dynamic content on a global scale.

Procedure

Procedure

Step 1: Enter the required information about the accelerated web service

You can enter the information about the accelerated web service in the GA console. The system then generates a list of recommended services, including a GA instance and a basic bandwidth plan.

  1. Log on to the Global Accelerator console.
  2. In the upper-right corner of the Instances page, click Purchase Guide.
    Note If this is the first time that you use the GA service, skip this step.
    Purchase Guide
  3. In the Enter the required information to generate a list of recommended services section, enter the required information.
    • Acceleration Area: Select the region that requires acceleration. In this example, China (Hong Kong) is selected.
    • Service Region: Select the region where the backend servers are located. In this example, US (Silicon Valley) is selected.
    • ICP Filing: If you need to accelerate a website, specify whether you have requested an Internet Content Provider (ICP) number for the domain name of the website. If the backend service is not a website, select No. In this example, No is selected.
      Note If you want to accelerate access to a service that is deployed in the Chinese mainland, you must obtain an ICP number for the service. For more information, see What is an ICP filing?.
    • Server Area: Specify whether the backend servers are deployed on Alibaba Cloud. On Alibaba Cloud is selected in this example.
    • Peak Bandwidth Range: Enter the bandwidth required during peak hours. Unit: Mbit/s. 10 is entered in this example.
    • Maximum Concurrent Connections: Specify the maximum number of concurrent connections that the GA instance supports. When the number of concurrent connections reaches the upper limit, new connection requests are dropped. 5 Thousand is selected in this example.
  4. Click Generate Service List.
    After a list is generated, you can check the recommended services in the list. Recommended service list

Step 2: Purchase a GA service bundle

You can purchase a GA service bundle based on the recommended service list. The list includes a GA instance and a basic bandwidth plan.

  1. Click Generate Service List.
    Purchase a service bundle
  2. On the buy page, set the following parameters for the GA instance:
    • Term: Select a subscription duration.
      Note The subscription duration applies to all services in the service bundle. For example, if you select 1 Year, the GA instance and the basic bandwidth plan are valid for one year.
    • Specification: Select a specification for the GA instance that you want to create. Small I (Specifications Unit) is selected in this example.
    • Bandwidth Type: Select the type of the basic bandwidth plan. Premium is selected in this example.
    • Peak Bandwidth: Specify the bandwidth limit of the basic bandwidth plan. The value is set to 10 Mb in this example.
  3. Click Buy Now and complete the payment.
  4. After you complete the payment, associate the basic bandwidth plan with the GA instance. For more information, see Associate a basic bandwidth plan.
After you purchase the service bundle, the system automatically assigns a CNAME to the GA instance. Requests destined for the CNAME are accelerated and resolved to the origin servers. CNAME

Step 3: Add an acceleration area

After you purchase a GA instance, you can add an acceleration area, specify the region to which clients belong, and then allocate resources to the region.

  1. On the Instances page, find the GA instance that you created in Step 2: Purchase a GA service bundle and click the instance ID.
  2. On the instance details page, click the Acceleration Areas tab. Then, click the Asia Pacific tab and click Add Region.
  3. In the Add Acceleration Area dialog box, specify the following acceleration area information and click OK.
    • Region: Select the region where users are located. In this example, China (Hong Kong) is selected.
    • Bandwidth: Select a bandwidth value for the acceleration region. 10 Mbit/s is entered in this example.
    • IP Protocol: Select the IP version of the clients that use GA. IPv4 is selected in this example.
After an acceleration area is added, GA assigns an accelerated IP address to each acceleration region in the area. The accelerated IP address is used to accelerate client access. 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. On the Configure Listener & Protocol wizard page, set the following parameters for the listener:
    Listeners
    ParameterDescription
    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 a protocol for the listener.

    In this example, TCP is selected.

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

    In this example, the value is set to 80.

    Client Affinity
    Specify whether to enable client affinity. If client affinity is enabled, requests from the same client are forwarded to the same endpoint when the client connects to 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 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 endpoints in the endpoint group.

  1. On the Configure Endpoint Group wizard page, set the following parameters for the endpoint group.
    ParameterDescription
    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 (destination servers) belongs.

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

    Backend Service
    Specify whether the FTP service is deployed on Alibaba Cloud.

    In this example, Alibaba Cloud is selected.

    Preserve Client IP
    Specify whether to preserve client IP addresses. After you enable this feature, backend servers can retrieve client IP addresses.

    In this example, client IP address preservation is disabled.

    Endpoint
    Endpoints are destinations of client requests. To add an endpoint, set the following parameters:
    • Backend Service Type: Select Alibaba Cloud Public IP Address.
    • Backend Service: Enter the public IP address of the backend service that you want to accelerate.
    • Weight: Enter the weight of the endpoint. Valid values: 0 to 255. GA distributes network traffic to endpoints based on their weights.
    Warning If the weight of an endpoint is set to 0, GA stops distributing 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: Activate CDN

CDN reduces the loads of the origin and helps avoid network congestion. You can use CDN to accelerate website content delivery in different areas and for different scenarios. You must activate CDN before you can use the service.
Note Skip this step if you have activated CDN.
  1. Log on to the product landing page of CDN.
  2. Click Activate Now.
  3. On the activation page, set Billing Method based on your business requirements.

    For more information about the billing methods of CDN, see Billing method.

  4. Select the Alibaba Cloud CDN Terms of Service check box, and click Activate Now.
  5. After CDN is activated, click Console to log on to the CDN console.

Step 7: Add an accelerated domain name

CDN retrieves resources from the origin servers and caches them on CDN edge nodes. When a client requests resources from an accelerated domain name, CDN retrieves the resources from the CDN node that is the nearest to the client.

  1. In the left-side navigation pane, click Domain Names.
  2. On the Domain Names page, click Add Domain Name.
  3. On the Add Domain Name page, set the following parameters to add an accelerated domain name.
    1. Configure basic information.
      ParameterDescription
      Domain Name to Accelerate
      Enter the domain name of the web service to be accelerated.

      www.example.com is entered in this example.

      Business Type
      Select the business type of your website.
      Business Type cannot be modified after it is set.
      • Image and Small File: If you need to accelerate the delivery of small-size and static resources, such as small files, images, and web style sheets, we recommend that you select this option. For more information, see Image and small file distribution.
      • Large File Download: For downloads of static content whose size is greater than 20 MB, we recommend that you select this option. Large file downloads refer to game package installation, app updates, mobile ROM upgrades, and app downloads. For more information, see Large file distribution.
      • VOD: If you need to accelerate the delivery of audio or video files for VOD playback, we recommend that you select this option. For more information, see On-demand audio and video streaming.
      • DCDN: If your website contains a large amount of dynamic and static content, and most of the requests are for dynamic resources, we recommend that you select this option. For more information, see What is DCDN?.

      Image and Small File is selected in this example.

      Region
      Select the area to be accelerated.

      Global (Excluding Mainland China) is selected in this example.

      Note If the area to be accelerated includes the Chinese mainland, your domain name must have an ICP number. For more information, see What is an ICP filing?.
    2. In the Origin Servers section, click Add Origin Server. In the Add Origin Server dialog box, set the following parameters.
      ParameterDescription
      Origin Info
      Enter the information about the origin server. If the requested resources are not cached on CDN edge nodes, requests are redirected to the origin server to retrieve the resources.

      Select Site Domain in this example, and enter the CNAME to the GA instance. For more information, see Step 2: Purchase a GA service bundle.

      Priority

      You can configure priorities to specify primary and secondary origin servers. The primary origin server has a higher priority than the secondary origin server. Alibaba Cloud CDN preferentially redirects requests to the primary origin server.

      In this example, Primary is selected.

      Weight

      If origin servers have the same priority, Alibaba Cloud CDN redirects requests to the origin servers based on their weights. This balances loads among the origin servers. The valid values of origin server weights are 1 to 100. A greater value indicates a higher weight. An origin server with a higher weight receives more user requests. The default weight is 10. You can specify a weight based on your business requirements.

      100 is entered in this example.

      Port

      The default port is port 80. You can specify a port based on the settings of your origin server. Valid values are 1 to 65535. Custom ports support only HTTP. If you want CDN to redirect HTTPS requests to origin servers over custom ports, see Configure the origin protocol policy.

      In this example, port 80 is used.

  4. Click Next and then click Return to Domain Names.
    After you add an accelerated domain name, CDN assigns a CNAME to the domain name. cname

Step 8: Configure DNS settings

After you add an accelerated domain name, you must modify the DNS record to resolve the domain name to CDN. Then, requests sent to the domain name can be forwarded to CDN edge nodes for acceleration. The following example shows how to configure the DNS record in the Alibaba Cloud DNS console.
Note If you use the DNS resolution service that is provided by a third-party service provider, log on to the platform of the service provider and modify the DNS record for your web application.
  1. Log on to the Alibaba Cloud DNS console.
  2. On the Manage DNS page, find the target domain name, and click Configure in the Actions column.
  3. On the Configure page, find the DNS records, and click Edit in the Actions column.
  4. In the Edit Record panel, set Type to CNAME and set Value to the CNAME that is assigned to the accelerated domain name in Step 7: Add an accelerated domain name. Modify the DNS record
  5. Click OK.

Step 9: Verify the settings

Use a computer that runs Windows in China (Hong Kong) to check how GA interacts with CDN to accelerate content delivery.

To test the acceleration performance, perform the following steps:

  1. Enter the domain name www.example.com into the address bar of the browser to access the web service deployed in the US (Silicon Valley) region.
  2. Open the CLI and run the following command to check the latency of data transmission:
    curl -o /dev/null -s -w "time_connect: %{time_connect}\ntime_starttransfer: %{time_starttransfer}\ntime_total: %{time_total}\n" "http[s]://<Web service domain name>[:<[Port>]"
    where:
    • time_connect: the period of time to establish a TCP connection.
    • time_starttransfer: the period of time for the backend server to send the first byte after the client sends a request.
    • time_total: the period of time for the backend server to respond to the session after the client sends a request.