Using AWS Global Accelerator to Reduce Network Latency

Reducing the latency with an easy implementation

Alejandro Castañeda Ocampo
Globant
6 min readMay 31, 2024

--

Image source: Unsplash

This article presents a basic demonstration of how AWS Global Accelerator can be used to reduce latency for globally distributed applications.

We’ll deploy an application in the Europe AWS region (eu-west-1) and measure the latency accessing it from an IP address in South America (Colombia). By comparing the latency with and without using Global Accelerator, the idea is to show how this AWS service can improve performance for users accessing applications from different locations around the world. This practical demo highlights the benefits of Global Accelerator for reducing geographical latency, a common challenge when operating globally distributed services.

Prerequisites

  • An AWS account.
  • Basic knowledge of AWS networking services like VPC, subnets, route tables, etc.

Overview of AWS Global Accelerator

AWS Global Accelerator is a network layer service that routes user traffic through Amazon’s global network infrastructure. By capitalizing on this backbone, applications gain a significant edge in terms of connectivity, benefiting from the meticulously optimized paths that minimize hops and avoid congested, less reliable segments of the internet.

Key features and benefits

  • Improved Performance: By automatically routing users to the nearest AWS edge location, Global Accelerator diminishes latency, providing faster and more consistent application performance.
  • Enhanced Reliability: Leveraging the AWS global network reduces points of failure, increasing the overall availability of your application.
  • Simplified Management: With AWS Global Accelerator, traffic rerouting due to endpoint health or regional changes is automatic, reducing the management overhead for developers and system administrators.
  • Global Reach with Localized Feel: Regardless of where your users are, they can enjoy a local-like experience as if your application’s infrastructure were right next door.
  • Protection and Security: AWS Global Accelerator includes built-in protections, such as AWS Shield Standard, to defend against common network and transport layer DDoS attacks, ensuring your services remain uninterrupted.

How it works

AWS Global Accelerator directs user traffic to the closest AWS edge location, where a consistently updated network map determines the most efficient path to your application endpoints, be they in AWS regions or external locations. The service then routes traffic to the optimal endpoints based on performance, endpoint health, and configured policies. This process is transparent to the end-user, but has a profound impact on their experience.

Implementation Overview

The diagram below represents a basic AWS network setup, and a simple web server deployed in EC2. As an extra network layer behind the EC2 server, we can see the Global Accelerator service’s main component of its demonstration to achieve the improvement in the latency.

Diagram of the implementation.

The diagram represents the following steps:

  1. Deploy a simple web application server (EC2) in the eu-west-2 region.
  2. Configure a Global Accelerator with listeners in the region where the application runs.
  3. Use the terminal to send a ping request to the IPs (2) provided by the AWS Global Accelerator.
  4. Use the same terminal to send a ping request directly to the public IP of the EC2 server deployed in the eu-west-2 region.
  5. Compare the time latency of the responses, and verify how using AWS Global Accelerator we’ll obtain a faster response.

We expect the accelerator to route traffic optimally and reduce latency for users.

Implementation Set Up

To streamline the deployment of our foundational infrastructure, as previously described, I have crafted an AWS CloudFormation template. This automated solution provisions an EC2 instance server, thereby simplifying and accelerating our implementation process.

AWS Cloudformation template that launches EC2 web server.

To create the AWS CloudFormation stack, we need to Log In to our AWS Console navigate to the CloudFormation module, and be sure that we are using the eu-west-2 region:

Search Cloudformation module, and select the London (eu-west-2) Region.

In the CloudFormation module, initiate the setup by choosing “Create stack”:

Cloudformation module, Create stack event.

Now we’re going to download the CloudFormation template on our machine and create the stack:

Upload the Cloudformation template to AWS console.

In the specification details, type the “Stack name” and choose “Next”:

Specification details of the Cloudformation stack.

Proceed through the subsequent screens, accepting the default settings by selecting “Next”. When you reach the final screen, confirm your choices and submit the CloudFormation stack by clicking on “Submit” to initiate the creation of the infrastructure components.

After a few seconds, the infrastructure will deploy, and we can see all the events of the CloudFormation stack:

Stack events during the creation.

On the outputs tab, we can see the outputs of the stack:

Outputs values of the Cloudformation stack.

Now we have a web server running on EC2 in eu-west-2:

EC2 web server running on eu-west-2.

The next step is configuring the AWS Global Accelerator and attaching the EC2 server as a listener, let’s do it now. Navigate to the Global Accelerator page in the AWS console, and choose “Create accelerator”:

AWS Global accelerator page.

Put the name of the Global Accelerator and select the “Standard” type option:

Set up AWS Global accelerator, step 1.

In the listeners’ configuration section, add as “Ports” the 80 and the “Protocol” as TCP:

Set up AWS Global accelerator, step 2.

Next, in the “Endpoint Group” section, select the region where was deployed the EC2 (eu-west-2):

Set up AWS Global accelerator, step 3.

In the “Configure health checks” section, set the following options:

Set HTTP protocol for health checks.

Finally, select the “Endpoint type” as “EC2 Instance” and the specific EC2 instance deployed before by the CloudFormation template:

Set up AWS Global accelerator, step 4.

After a few minutes, our Global Accelerate will be created, and we can see that Global Accelerator assigns two static IP addresses to provide redundancy and failover capabilities, ensuring higher availability for our application:

AWS Global Accelerator deployed successfully.

Measuring The Network Latency

Now we’ll test the main intention of its implementation, to measure how the AWS Global Accelerator helps us to reduce the network latency. The following image shows the network latency without AWS Global Accelerator enabled:

Ping directly to the public IP of the EC2 instance.

The next image shows the network latency with AWS Network Accelerator enabled:

Ping directly to AWS Global Accelerator public IP.

In the images above, we can see the benefits of using AWS Global Accelerator to reduce latency. In this case, using the public IPs of the Global Accelerator is faster (more than 70%) compared with the EC2 instance public IP.

The provided images illustrate the significant latency reduction achieved by leveraging AWS Global Accelerator. Employing the service’s static IP addresses yields performance improvements, achieving over a 70% faster 🚀 response time compared to directly accessing the EC2 instance via its public IP. This demonstrates AWS Global Accelerator’s effectiveness in enhancing application speed and user experience.

Conclusions

AWS Global Accelerator leverages AWS’ global network to route traffic intelligently to reduce latency. It’s suitable for applications deployed in one region but accessed globally.

Our demo showed significantly reduced latency from Colombia when accessing an application in Europe through Global Accelerator. Based on your use cases, Global Accelerator can help improve performance for users worldwide.

References

--

--