Using Global Accelerator to Speed Up Cross-Border Access to Web Servers
Overview
Application scenario: If you deploy your web server in the Chinese mainland, users outside the Chinese mainland may face problems such as high latency, packet loss, and jitter, due to unstable cross-border networks. To address these issues, you need a global accelerator.
Solution architecture: Suppose you have a web server deployed in CN East-Shanghai1 and your domain name has been licensed and mapped to the EIP in CN East-Shanghai1 bound to the server. Users can access your website using the domain name over the Internet. To accelerate cross-border access to your website, you can use DNS to map your domain name to the anycast IP address of a global accelerator, so that users across the globe can access your website faster through the Huawei backbone network.
Resource and Cost Planning
Resource |
Description |
Quantity |
Price |
---|---|---|---|
Global accelerator |
You are charged based on how long each global accelerator is retained in your account. The smallest billing unit is one hour. Partial hours are counted as full hours. Global accelerator price = Unit price x Required duration |
1 |
For details, see Global Accelerator Pricing Details. |
Data transfer |
You are charged for either the inbound or outbound traffic, in GB, whichever direction has more traffic. Data transfer price = Unit price x Traffic used |
Per actual use |
|
Record sets added to the public zone |
Three A record sets are required for users in different areas:
|
3 |
Free |
Flowchart
Step 1: Apply for a cross-border permit.
In accordance with the laws and administrative regulations of the Ministry of Industry and Information Technology (MIIT) of the People's Republic of China, only China Mobile, China Telecom, and China Unicom are allowed for cross-border network communications, and a cross-border permit is required if you carry out business activities outside the Chinese mainland.
- Click Request a Cross-Border Permit.
The Cross-Border Service Application System page is displayed.
Figure 1 Applying for a cross-border permit
- On the application page, set related parameters and upload related materials.
- Click Submit.
Step 2: Buy a global accelerator.
To use Global Accelerator for faster access, you first need to create a global accelerator.
- On the Global Accelerator page, click Buy Global Accelerator.
Figure 2 Buying a global accelerator
- Set parameters. Select Outside the Chinese mainland for Applicability. For other parameters, see Table 2.
Figure 3 Creating a global accelerator
Table 2 Parameters for configuring a global accelerator Parameter
Description
Name
Name of the global accelerator you want to create.
Only letters, digits, and hyphens are allowed.
You can enter up to 64 characters.
Enterprise Project
An enterprise project you would like to use to centrally manage your Global Accelerator resources.
You can use an existing enterprise project or create one.
Applicability
Where the global accelerator will be used.
There are two options: Outside the Chinese mainland or Chinese mainland. Outside the Chinese mainland is selected by default.
Outside the Chinese mainland is recommended for this practice.
IP Address Type
The type of the IP address used by the global accelerator.
IPv4 is selected by default.
Tags
An identifier of the global accelerator. Each tag consists of a key and a value. You can add 20 tags for a global accelerator.
NOTE:If a predefined tag has been created in TMS, you can select the corresponding tag key and value.
For details about predefined tags, see Predefined Tag Overview.
If you have configured tag policies for Global Accelerator, you need to add tags to your accelerators based on the tag policies. If you add a tag that does not comply with the tag policies, global accelerators may fail to be created. Contact the administrator to learn more about tag policies.
Description
Supplementary information about the global accelerator.
You can enter up to 255 characters.
- Click Next.
Step 3: Add a listener to the global accelerator.
Add a listener to the global accelerator to route requests across endpoints based on the client affinity you set.
Parameter |
Description |
---|---|
Name |
Listener name. Only letters, digits, and hyphens are allowed. You can enter up to 64 characters. |
Protocol |
The protocol used by the listener to receive requests from clients. The protocol can be TCP or UDP. |
Port |
The ports or port ranges used by the listener to receive requests from clients. The port number ranges from 1 to 65535. You can enter one or more ports or port ranges separated by commas (,). Example: 1-10,11-50,51,52-200 |
Client Affinity |
How requests are routed. There are two options: None: The listener routes requests evenly among the endpoints in the endpoint group. Source IP address (only for TCP and UDP listeners): The source IP address of each request is calculated using the consistent hashing algorithm to obtain a unique hash key, and all the endpoints are numbered and mapped to the hash keys. Requests from the same IP address are forwarded to the same endpoint for processing. |
Tags |
An identifier of the listener. Each tag consists of a key and a value. You can add up to 20 tags to a listener.
NOTE:
If a predefined tag has been created in TMS, you can select the corresponding tag key and value. For details about predefined tags, see Predefined Tag Overview. If you have configured tag policies for Global Accelerator, you need to add tags to your listeners based on the tag policies. If you add a tag that does not comply with the tag policies, listeners may fail to be created. Contact the administrator to learn more about tag policies. |
Description |
Supplementary information about the listener. You can enter up to 255 characters. |
Step 4: Associate an endpoint group with the listener.
Associate an endpoint group with the listener in the CN East-Shanghai1 region and add an endpoint to this endpoint group as instructed by Table 4.
Item |
Parameter |
Description |
---|---|---|
Endpoint group |
Name |
Name of the endpoint group. Each listener can be associated with only one endpoint group in a given region. Only letters, digits, and hyphens are allowed. You can enter up to 64 characters. |
Region |
Region where the endpoint group is used. Select CN East-Shanghai1 for this practice. |
|
Description |
Supplementary information about the endpoint group. You can enter up to 255 characters. |
|
Traffic Dial |
The percentage of traffic directed to the endpoint group. If you increase the traffic dial, more requests will be distributed to this endpoint group. The value ranges from 0 to 100. If you set the traffic dial to 0, no requests will be distributed to this endpoint group.
NOTE:
If a listener has multiple endpoint groups, traffic will be first distributed to the endpoint group with the lowest latency and then to other endpoint groups based on the traffic dial value you set. |
|
Endpoint |
A single point of contact for clients. Global Accelerator distributes incoming traffic across healthy endpoints. Select EIP for this practice. |
|
Health Check |
Health Check |
Whether to enable health check. If you disable health check, requests may be forwarded to unhealthy endpoints. |
Protocol |
The protocol used for health check. It can be TCP. Default value: TCP. |
|
Port |
The port used for health check. The port number ranges from 1 to 65535. |
|
Advanced Settings |
||
Interval (s) |
The maximum time between two consecutive health checks, in seconds. The interval ranges from 1 to 60. |
|
Timeout (s) |
The maximum time required for waiting for a response to a health check request, in seconds. The timeout ranges from 1 to 60. |
|
Maximum Retries |
The maximum number of health check retries allowed. The value ranges from 1 to 10. |
Step 5: Add record sets.
Add record sets to map your domain name to the anycast IP address of the global accelerator or the EIP bound to your web server.
This section uses Huawei Cloud DNS as an example.
- Go to the Public Zones page.
- On the Public Zones page, click the target domain name.
The Record Sets page is displayed.
- In the upper right corner of the page, click Add Record Set.
- On Add Record Set page, add three record sets as instructed by Table 5.
Figure 5 Adding an A record set
- Click OK.
- Switch back to the Record Sets tab.
View the record sets you have added and ensure that their status is Normal.
Verifying Acceleration
You can run the curl command on a Windows PC in the area where acceleration is required to check whether the access is accelerated.
- Open the cmd window and run nslookup <Website domain name > to check whether the anycast IP address is returned.
- Run the following command to check the latency of accessing the EIP in CN East-Shanghai1 over the public network:
curl -o /dev/null -s -w "time_connect: %{time_connect}\ntime_starttransfer: %{time_starttransfer}\ntime_total: %{time_total}\n" "http[s]://<IP>[:<Port>]"
- IP: EIP bound to your web server.
- Port: HTTP port number used by the web server.
- time_connect: time taken to establish a TCP connection, in seconds. It is from the time when a TCP connection request is initiated to the time when the connection is established.
- time_starttransfer: time when transfer starts, in seconds. It is from the time when the client sends a request to the time when the endpoint replies with the first byte.
- time_total: total connection time, in seconds. It is from the time when the client sends a request to the time when the endpoint responds to the request.
- Run the following command to check the latency of accessing the anycast IP address:
curl -o /dev/null -s -w "time_connect: %{time_connect}\ntime_starttransfer: %{time_starttransfer}\ntime_total: %{time_total}\n" "http[s]://<IP>[:<Port>]"
Set IP in the command to the anycast IP address provided by Global Accelerator.
- Compare the values of time_connect and view the latency before and after acceleration.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot