Help Center> Global Accelerator> Getting Started> Accelerating Access to an Application
Updated on 2022-09-30 GMT+08:00

Accelerating Access to an Application

Global Accelerator helps accelerate access to an application and improves the availability of the application for your global users.

Example Scenario

As shown in Figure 1, a multinational enterprise has two branches, one in Singapore and one in Hong Kong. The Singapore branch has deployed an application on two servers in the CN South-Guangzhou region, and the Hong Kong branch has deployed an application on two servers in the CN-Hong Kong region.

Global Accelerator is required for each branch to access the cloud network from the nearest access point and access their application faster.

Figure 1 Network topology

When users in the Singapore branch access the application in the CN South-Guangzhou region, requests are sent to the anycast IP address in Singapore. The listener then distributes the requests evenly between endpoint 1 and endpoint 2.

Similarly, when users in the Hong Kong branch access the application in the CN-Hong Kong region, requests are sent to the anycast IP address in Hong Kong. The listener then distributes 20% of the requests to endpoint 3 and 80% of the requests to endpoint 4.

Configuration Process

Procedure

  1. Apply for a cross-border permit (mandatory in cross-border communication scenarios).

    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 three major operators in the Chinese mainland are allowed for cross-border network communications, and a cross-border permit is required if you carry out business activities outside the Chinese mainland.

    If the acceleration area is inside the Chinese mainland, but the endpoint group is outside the Chinese mainland, or the endpoint group is inside the Chinese mainland but the acceleration area is outside the Chinese mainland, you need to apply for a cross-border permit.

    1. Log in to the management console.
    2. On the homepage, click in the upper left corner and choose Networking > Global Accelerator.

      The Global Accelerator page is displayed.

    3. In the navigation pane on the left, click Cross-Border Permit.
    4. Click Submit Application.
    5. On the application page, set related parameters as prompted and upload related materials.
      Table 1 Online cross-border permit application

      Parameter

      Customer Name

      Huawei Cloud ID

      Product Type

      Subscribed Bandwidth

      Contractually Effective

      Terminating a Contract

      Customer Type

      Country

      Customer Contact

      Phone Number

      Certificate Type of the Contact

      Certificate No. of Contact

      Business Scope

      Enterprise Scale (Number of Employees)

      Average Bandwidth Per User

      Country Where the Customer's Domestic and Overseas Branches Are Located

      Table 2 Required materials

      Material

      Signature

      Seal

      Description

      A scanned copy of your company's business license

      -

      See the template Huawei Cloud provides for the position of the seal.

      A scanned copy of Huawei Cloud Cross-Border Circuit Service Agreement

      • Sign the material on the signature block.
      • Stamp the seal over the signature.

      A scanned copy of China Unicom Letter of Commitment to Information Security of the Cross-Border Circuit Service

      • Sign the material on the signature block.
      • Stamp the seal over the signature.
      • Specify the bandwidth you estimated.
    6. Click Create Now.

  2. Create a global accelerator.

    To use Global Accelerator for faster access, you first need to create a global accelerator.

    1. Log in to the management console.
    2. On the homepage, click in the upper left corner and choose Networking > Global Accelerator.

      The Global Accelerator page is displayed.

    3. Click Buy Global Accelerator.
    4. Specify the parameters listed in Table 3.
      Figure 2 Creating a global accelerator
      Table 3 Parameters required for creating a global accelerator

      Parameter

      Description

      Name

      Name of the global accelerator you want to create.

      You can enter up to 64 characters. Only letters, digits, and hyphens are allowed.

      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.

      Outside the Chinese mainland is selected by default.

      Tags

      The identifier of a global accelerator and consists of a key and a value. You can add 20 tags for a global accelerator.

      Tag keys and values must meet the requirements listed in Table 4.

      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.

      Description

      Supplementary information about the global accelerator.

      You can enter up to 255 characters.

      Table 4 Tag key and value requirements

      Parameter

      Requirements

      Key

      • Cannot be left blank.
      • Can contain letters in any language, Chinese characters, digits, spaces, underscores (_), periods (.), colons (:), equal signs (=), plus signs (+), hyphens (-), and at signs (@).
      • Cannot start or end with a space.
      • Cannot start with _sys_.
      • Can contain a maximum of 43 characters.

      Value

      • Can be left blank.
      • Can contain letters in any language, Chinese characters, digits, spaces, underscores (_), periods (.), colons (:), slashes (/), equal signs (=), hyphens (-), and at signs (@).
      • Cannot start or end with a space.
      • Can contain a maximum of 255 characters.
    5. Click Next.

      The Add Listener page is displayed.

  3. Add a listener to the global accelerator.

    Associate an endpoint group with the listener in AP-Singapore region and add endpoint 1 and endpoint 2 to the endpoint group. The listener will listen to requests and routes them to the two endpoints based on the load balancing algorithm.

    For details about the parameters, see Table 5.
    Figure 3 Adding a listener
    Table 5 Parameters required for adding a listener

    Item

    Parameter

    Description

    Basic Configuration

    Name

    Listener name.

    You can enter up to 64 characters. Only letters, digits, and hyphens are allowed.

    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 and separate multiple them by commas (,).

    Example: 1-10,11-50,51,52-200

    Client Affinity

    • If you select None, the listener routes requests evenly among the endpoints in the endpoint group.
    • If you select Source IP address, 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.

    TCP and UDP listeners support only Source IP address.

    Tags

    The identifier of a global accelerator and consists of a key and a value. You can add 20 tags for a global accelerator.

    Tag keys and values must meet the requirements listed in Table 4.

    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.

    Description

    Supplementary information about the listener.

    You can enter up to 255 characters.

    Endpoint Groups

    Name

    Name of the endpoint group.

    Each listener can be associated with only one endpoint group in a given region.

    You can enter up to 64 characters. Only letters, digits, and hyphens are allowed.

    Region

    Region to which the endpoint group belongs.

    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.

    If you set the traffic dial to 0, no requests will be distributed to this endpoint group.

    The value ranges from 0 to 100.

    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

    An endpoint serves as a single point of contact for clients, and Global Accelerator distributes incoming traffic across healthy endpoints.

    • Endpoint 1: EIP bound to server 1 (88.xx.xx.10)
    • Endpoint 2: EIP bound to server 2 (10.xx.xx.11)

    Set the weights of the two endpoints both to 1.

    Health Check

    Health Check

    Whether to enable health check.

    If you disable health check, requests may be forwarded to unhealthy endpoints.

    Protocol

    Currently, only TCP can be used for health check.

    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.

    Table 6 Tag key and value requirements

    Parameter

    Requirements

    Key

    • Cannot be left blank.
    • Can contain letters in any language, Chinese characters, digits, spaces, underscores (_), periods (.), colons (:), equal signs (=), plus signs (+), hyphens (-), and at signs (@).
    • Cannot start or end with a space.
    • Cannot start with _sys_.
    • Can contain a maximum of 43 characters.

    Value

    • Can be left blank.
    • Can contain letters in any language, Chinese characters, digits, spaces, underscores (_), periods (.), colons (:), slashes (/), equal signs (=), hyphens (-), and at signs (@).
    • Cannot start or end with a space.
    • Can contain a maximum of 255 characters.

  4. Associate another endpoint group with the listener.

    Associate an endpoint group with the listener in CN-Hong Kong region and add endpoint 3 and endpoint 4 to this endpoint group.

    1. Click Add Endpoint Group and specify the parameters listed in Table 7.
      Table 7 Parameters required for adding an endpoint group

      Item

      Parameter

      Description

      Endpoint Groups

      Name

      Name of the endpoint group.

      Each listener can be associated with only one endpoint group in a given region.

      You can enter up to 64 characters. Only letters, digits, and hyphens are allowed.

      Region

      Region to which the endpoint group belongs.

      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.

      If you set the traffic dial to 0, no requests will be distributed to this endpoint group.

      The value ranges from 0 to 100.

      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

      An endpoint serves as a single point of contact for clients, and Global Accelerator distributes incoming traffic across healthy endpoints.

      • Endpoint 3: EIP bound to server 3 (97.xx.xx.159)
      • Endpoint 4: EIP bound to server 4 (10.xx.xx.240)

      Set the weight of endpoint 3 to 1, and the weight of endpoint 4 to 4.

      Health Check

      Health Check

      Whether to enable health check.

      If you disable health check, requests may be forwarded to unhealthy endpoints.

      Protocol

      Currently, only TCP can be used for health check.

      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.

      As shown in this example, users in the Singapore branch have faster access to the application on servers in the CN South-Guangzhou region than to that in the CN-Hong Kong region. Requests are preferentially sent to servers in the CN South-Guangzhou region.

      If the percentage of traffic directed to the endpoint group 1 and endpoint group 2 are set to 80%, requests from users in Singapore and Hong Kong are distributed as follows:

      • 80% of the requests from users in Singapore will be sent to endpoint group 1, and the remaining 20% of the requests to the endpoint group 2.
      • 80% of the requests from users in Hong Kong will be sent to the endpoint group 2, and the remaining 20% of the requests to the endpoint group 1.
      Figure 4 Cross-border traffic dial
    2. Click Save.
    3. Click Next and confirm the configuration.
    4. Click Submit.
    5. If message "Accelerator xxx created successfully" is displayed, click Finish.

Verifying Global Accelerator

The listener uses TCP to receive requests from clients, so you can run curl to verify that the global accelerator is working normally. Run curl before and after you configure Global Accelerator and compare the values of time_connect.

  1. Before you configure Global Accelerator, run the following command on a server in the tested region:
    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 the application server.
    • Port: HTTP port number used by the application 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.
  2. After you configure Global Accelerator, run the following command:
    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 in the region.

  3. Compare the values of time_connect and view the latency before and after acceleration.