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 scenario in the following figure 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 may frequently occur. This is because the cross-border Internet is unstable. Scenarios

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 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 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 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. 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 existing 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 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.
    • Peak Bandwidth: Specify the maximum bandwidth value of the basic bandwidth plan. The value is set to 10 Mb 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.
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, and click Add Region on the Asia Pacific tab.
  3. In the Add Acceleration Area dialog box, set the following parameters, and click OK.
    • Regions: 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.
    • Internet Protocol: Select the IP protocol of the clients that use GA. IPv4 is selected in this example.
      Note IPv6 is available to only users in the whitelist. If you want to use this feature but you are not included in the whitelist, submit a ticket.
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 addresses

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 region 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:
    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 belongs, which is the region to which the destination servers belong.

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

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

    On Alibaba Cloud is selected in this example.

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

    In this example, this feature is disabled.

    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 Alibaba Cloud Public IP Address.
    • Backend Service: Enter the public IP address of the backend service that you want to accelerate.
    • Weight: Specify a weight for the endpoint. Valid values: 0 to 255. GA routes traffic to endpoints based on the specified 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: 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 Buy Now.
  3. On the activation page, specify Billing Method based on your business requirements.

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

  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.
      Parameter Description
      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.
      After you set Business Type, you cannot change it. Proceed with caution.
      • 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 mainland China, 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.
      Parameter Description
      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 set priorities to specify primary and secondary origin servers. The primary origin server has a higher priority than a secondary origin server. CDN preferentially redirects requests to the primary origin server.

      In this example, Primary is selected.

      Weight

      If origin servers have the same priority, 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 priority. 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, submit a ticket.

      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 service.
  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. Edit 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 check 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.
    The check result shows that you can access the web service that is deployed in the US (Silicon Valley) region by using the domain name www.example.com. Test the connectivity
  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>[:<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.
    The check result shows that the latency of data transmission from China (Hong Kong) to US (Silicon Valley) is reduced after GA is set to interact with CDN.
    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
    Test the latency of data transmission
    Note The acceleration performance varies based on the actual workloads.