All Products
Search
Document Center

Global Accelerator:Use GA and Alibaba Cloud CDN to accelerate content retrieval from origin servers

Last Updated:Jan 16, 2024

Global Accelerator (GA) can be used together 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. 配置场景

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

配置步骤

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 GA 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.

    购买向导

  3. In the Enter the required information to generate a list of recommended services section, enter the required information.

    • Acceleration Area: Select the region where acceleration is required. 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 web service, specify whether you have requested an Internet Content Provider (ICP) number for the domain name of the web service. If the backend service is not a web service, select No. In this example, No is selected.

      Note

      If the accelerated service is deployed in the Chinese mainland or the acceleration region is in the Chinese mainland, you must obtain an ICP number before you can provide the service. For more information, see What is an ICP filing?

    • Server Area: Specify whether the backend servers are deployed on Alibaba Cloud. In this example, On Alibaba Cloud is selected.

    • Peak Bandwidth Range: Enter the bandwidth required during peak hours. Unit: Mbit/s. In this example, 10 is entered.

    • 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 discarded. In this example, 5 Thousand is selected.

  4. Click Generate Service List.

    After a list is generated, you can check the recommended services in the list.加速方案

Step 2: Purchase a 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 Buy 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 the subscription duration to one year, you subscribe to both the GA instance and basic bandwidth plan for one year.

    • Specification: Select a specification for the GA instance that you want to create. In this example, Small I (Specifications Unit) is selected.

    • Bandwidth Type: Select the bandwidth type of the basic bandwidth plan. In this example, Premium is selected.

    • Peak Bandwidth: Specify the maximum bandwidth of the basic bandwidth plan. In this example, the value is set to 10 Mb.

  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, configure the parameters and click OK. The following table describes the parameters.

    • Region: Select the region where users are located. In this example, China (Hong Kong) is selected.

    • Bandwidth: Specify a maximum bandwidth value for the acceleration region. In this example, 10 Mbit/s is entered.

    • IP Protocol: Select the IP version of the clients that use GA. In this example, IPv4 is selected.

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.

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:

    监听

    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 a protocol for the listener.

    In this example, TCP is selected.

    Port Number

    Specify a listener port to receive and forward requests to endpoints. Valid values: 1 to 65499.

    In this example, port 80 is used.

    Client Affinity

    Specify whether to enable client affinity. If you enable client affinity, requests from the same client are forwarded to the same endpoint when the client connects to a stateful application.

    In this example, Source IP 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 endpoint in the endpoint group.

  1. On the Configure Endpoint Group wizard page, set the following parameters for the endpoint group:

    The following table describes only the parameters that are relevant to this topic. For more information, see Create and manage the endpoint groups of intelligent routing listeners.

    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.

    Select Acceleration Region

    Select the region to which the endpoint group (destination servers) belongs.

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

    Endpoint Configuration

    Client requests are routed to endpoints. To add an endpoint, configure 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 a weight for the endpoint. Valid values: 0 to 255. GA distributes network traffic to endpoints based on the configured weights.

    Warning

    If the weight of an endpoint is set to 0, GA stops distributing network traffic to the endpoint. Proceed with caution.

    Preserve Client IP

    Specify whether to preserve client IP addresses.

    If you enable this feature, the backend server can obtain client IP addresses. For more information, see Preserve client IP addresses.

    In this example, Preserve Client IP is disabled.

  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. Visit the product page of Alibaba Cloud CDN.

  2. Click Activate Now.

  3. On the activation page, specify Billing Method based on your business requirements.

    For information about the billing rules 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, configure the following parameters to add an accelerated domain name.

    1. Set the parameters in the Basic Configuration section.

      Parameter

      Description

      Domain Name to Accelerate

      Enter the domain name of the web service to be accelerated.

      In this example, www.example.com is entered.

      Business Type

      Select the business type of your website.

      After you configure the Business Type parameter, you cannot modify the value.

      • 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 the "Image and small file distribution" section of the Common scenarios topic.

      • 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 the "Large file distribution" section of the Common scenarios topic.

      • 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 the "On-demand audio and video streaming" section of the Common scenarios topic.

      • 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?

      In this example, Image and Small File is selected.

      Region

      Select the area to be accelerated.

      In this example, Global (Excluding Mainland China) is selected.

      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.

      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 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 Name List.

    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 OSS bucket.

  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.

  5. Click Confirm.

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]://<the domain name of the web service>[:<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.