×
Community Blog Optimize Global Application Performance with Intelligent DNS and GTM Integration

Optimize Global Application Performance with Intelligent DNS and GTM Integration

This article discusses tools like NAT Gateway, EIP, and SLB within a VPC for secure and efficient internet connectivity, highlighting the role of the ...

By Sunny Jovita, Solution Architech Alibaba Cloud Indonesia

When the cloud products in a Virtual Private Cloud (VPC) need to communicate with the internet, several tools and services can be utilized to establish this connection efficiently and securely. Among these tools, Network Address Translation (NAT) Gateway, Elastic IP (EIP), and Server Load Balancer (SLB) are essential components for managing internet connectivity and traffic flow within a VPC.

1

Global Traffic Manager (GTM) vs Server Load Balancer (SLB)

While both GTM and SLB are use to manage traffic flow, they serve different purposes and operate at different levels within the network architecture.

2

Global Traffic Manager (GTM)

Global Traffic Manager acts as a single point of control for managing traffic flow across an entire infrastructure, irrespective of its geographical location. GTM simplifies configuration and management by using Domain Name System (DNS) to resolve a domain name to multiple IP addresses. This allows different users to access different IP addresses based on various factors such as user location, server availability, and custom routing policies.

GTM provides the following advantages:

  • Inter-Regional Load Balancing: GTM can direct traffic across different regions or globally, balancing the load based on factors like user location and server health.
  • Health Checks and Failover: GTM uses health checks to dynamically update the IP addresses resolved by DNS, implementing fault isolation and failover. This ensures that users can access application services even if some servers encounter faults or disasters.
  • Traffic Management Across Multiple IPs: GTM allows users to access application services directly by resolving to the related IP addresses without needing to connect to GTM itself.

3

Server Load Balancer

In terms of managing traffic flow, SLB can be utilized too, but GTM is more to inter-regional load balancing. SLB serves as a proxy to which user requests are sent, and then distributes these requests across different instances within the same region.

In most cases, SLB can be used to balance workloads across multiple IP addresses that reside in the same region. If you need to balance workloads across multiple SLB addresses that reside in different regions, use GTM.

4
5

GTM Scenarios

Let’s take a look at several scenarios on how GTM works along with intelligent resolution DNS.

Scenario 1:

In most cases, enterprises deploy their application services on multiple servers whose IP addresses may come from data centers of different countries, regions, Internet service providers (ISPs), or vendors. You can use the Intelligent DNS resolution feature of Alibaba Cloud DNS to forward user requests to the nearest application servers.

Multiple servers -> multiple IP addresses.

However, DNS servers cannot detect the availability of IP addresses. So, when some IP addresses are unavailable because the corresponding application servers encounter faults or disasters, the DNS servers may still return the IP addresses of these faulty application servers to users. As a result, users fail to access the applications.

Solutions

  • Enable the intelligent DNS resolution feature of Alibaba Cloud DNS to forward user requests to the nearest application servers.
  • Enable the health checks feature of Global Traffic Manager (GTM) to implement failover or redundancy.

Sample Servers

Servers are built in:

  • Indonesia as a primary server (users from Asia)
  • Singapore as a secondary server
  • US Virginia as a primary server (users from America)

Sample Clients

Some clients who access the server are coming from:

  • Singapore
  • US
  • Europe
  • Japan

Expected Results

  • The requests of users from Asia (Singapore, Japan) are forwarded to the application servers whose IP addresses in the Indonesia region.
  • The requests of users from Europe and US are forwarded to the application servers whose IP addresses in the US (Virginia) region.

Expected Failover Results

  • Failover between the application servers in the Indonesia and Singapore regions.
  • Failover between the application servers in the US (Virginia) and Singapore regions.

If the application servers in the Indonesia region are faulty, access traffic to the Indonesia region is forwarded to the application servers in the Singapore region. This ensures business continuity.

What Need to Be Tested

  • PING protocol to check whether it goes to the correct server continent
  • How's the speed to download a file

Procedure

Need to 2 Global Traffic Manager (GTM) Instances.

  • GTM-US

    • Primary pool: set IP address US server (47.252.113.53)
    • Secondary pool: set IP address SG server (47.236.253.37)
    • Access policy: global
    • DNS request source: Outside China > North America
  • GTM-Asia

    • Primary pool: set IP address IDN server (147.139.207.213)
    • Secondary pool: set IP address SG server (47.236.253.37)
    • Access policy: global
    • DNS request source: Outside China > Asia

6

Note:

This implementation restricts website access to only Asian and North American countries. Other regions are unable to access the website due to the specificity of the DNS request sources, which are configured to route exclusively to Asian and North American destinations

Clients – PING Results

● User from US (Silicon Valley) access the website

Directed to the US (Virginia) server

7

● User from Japan access the website

Directed to the Indonesia server

8

● User from Singapore access the website

Directed to the Indonesia server

9

● User from Germany (Frankfurt) access the website

Unable to access the server, because the servers are routing only to Asia and North America areas.

root@iZgw8fi78u5t2e3cp7hsaaZ:~# ping collector.sunnydemo.cfd
ping: collector.sunnydemo.cfd: Name or service not known

Inefficient Result

The initial setup is not efficient because it limits access to only two continents (Asia and North America), which negatively affects users from other regions.

Proposed Solution

To improve accesibility, we propose a second approach where we configure the second GTM to handle requests from outside China without specifying North America. This adjustment allows users in Europe to access the second GTM, directing them to the nearest server in the US (Virginia).

Second Approach

To ensure that users from both Asia and North America can access the website effectively, we will change the GTM-US DNS request source to "Outside China" only.

Procedure

Need to 2 Global Traffic Manager (GTM) Instances.

  • GTM-US

    • Primary pool: set IP address US server (47.252.113.53)
    • Secondary pool: set IP address SG server (47.236.253.37)
    • Access policy: global
    • DNS request source: Outside China
  • GTM-Asia

Primary pool: set IP address IDN server (147.139.207.213)

Secondary pool: set IP address SG server (47.236.253.37)

Access policy: global

DNS request source: Outside China > Asia

10

Clients – PING results

● User from US (Silicon Valley) accesses the website

Directed to the US (Virginia) server

11

● User from Japan accesses the website

Directed to the Indonesia server

12

● User from Singapore accesses the website

Directed to the Indonesia server

13

● User from Germany (Frankfurt) accesses the website

Directed to US (Virginia) server

14

Clients – Download File Result

We tested with a huge file being downloaded from each server to see how fast the download speed is.

File: 615,2 MB

15

● User from US (Silicon Valley) downloads the file

Result: 52s from US (Virginia) server

16

● User from Japan downloads the file

Result: 49s from IDN server

17

● User from Singapore downloads the file

Result: 48s from IDN server

18

● User from Germany (Frankfurt) downloads the file

Result: 50s from US (Virginia) server

19

This testing result shows that the combination of Intelligent DNS resolution and GTM are suitable to manage applications or resources deployed across multiple regions or globally and need to manage traffic flow based on factors like user location, server health, and custom routing policies, which leads to faster loading times and reduced latency.

Additional Notes

While assessing the second approach, some questions arose:

20

What will happen if we configure the GTM as follows:

1st GTM: Outside China

2nd GTM: Outside China -> Asia

Potential Issues

● Will this setup cause redundancy since Asia is included in "Outside China"?

● Will it only use the first GTM, or will there be collisions?

● Will Asian users go to the first GTM and users from other regions to the second GTM?

There won't necessarily be a collision if you set up the GTM instances this way.

Routing Logic

● The second GTM instance will handle routing for users from outside Mainland China and within Asia

● The first GTM instance will handle users from outside Mainland China but outside of Asia (Europe, US)

Intelligent Resolution Records:

● If the same subdomain name is used for users from different regions, the number of GTM instance required is determined by the number of intelligent resolution records.

● In this example, different IP addresses are returned to users from Indonesia and the US (Virginia), requiring two intelligent resolution records. Therefore, it's recommended to purchase 2 GTM instances.

Checking Users from Outside Mainland China:

A. When a user accesses your website, their DNS request reaches your main DNS zone.

B. Based on the user's location (if your DNS provider offers geo-location routing), they might be directed to a specific CNAME record depending on whether they're outside mainland China or not.

C. If location-based routing isn't available in your DNS provider, all users will be directed to a single CNAME record.

What Happens After Checking "Outside Mainland China":

First GTM Instance (Asia):

● If the user is indeed outside mainland China, the first GTM instance would then check for their specific location (likely based on their IP address).

● If the user is in Asia, the GTM instance would route them to the appropriate server group or backend server in the Asian region.

Second GTM Instance (Other Regions):

● Users who aren't identified as being in Asia by the first GTM instance would be considered "outside mainland China and outside of Asia" and would be routed by the second GTM instance.

● Similar to the first instance, the second GTM instance would determine the user's specific location (Europe, US) and route them to the appropriate server group or backend server in that region.

0 1 0
Share on

Alibaba Cloud Indonesia

97 posts | 14 followers

You may also like

Comments