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.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.
- Log on to the Global Accelerator console.
- 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.
- 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.
- Click Generate Service List. After a list is generated, you can check the recommended services in the 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.
- Click Generate Service List.
- 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.
- Term: Select a subscription duration.
- Click Buy Now and complete the payment.
- After you complete the payment, associate the basic bandwidth plan with the GA instance. For more information, see Associate a basic bandwidth plan.
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.
- On the Instances page, find the GA instance that you created in Step 2: Purchase a GA service bundle and click the instance ID.
- On the instance details page, click the Acceleration Areas tab. Then, click the Asia Pacific tab and click Add Region.
- 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.
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.
- On the instance details page, click the Listeners tab and then click Add Listener.
- 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. 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.
- 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.
- 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 (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. - Click Next, confirm the configurations of the listener and endpoint, and then click Submit.
Step 6: Activate CDN
- Log on to the product landing page of CDN.
- Click Activate Now.
- On the activation page, set Billing Method based on your business requirements.
For more information about the billing methods of CDN, see Billing method.
- Select the Alibaba Cloud CDN Terms of Service check box, and click Activate Now.
- 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.
- In the left-side navigation pane, click Domain Names.
- On the Domain Names page, click Add Domain Name.
- On the Add Domain Name page, set the following parameters to add an accelerated domain name.
- Click Next and then click Return to Domain Names. After you add an accelerated domain name, CDN assigns a CNAME to the domain name.
Step 8: Configure DNS settings
- Log on to the Alibaba Cloud DNS console.
- On the Manage DNS page, find the target domain name, and click Configure in the Actions column.
- On the Configure page, find the DNS records, and click Edit in the Actions column.
- 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.
- 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:
- 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.
- 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.
Was this helpful?