Single-Digit ms latency with AWS Local Zone
Tags: localzone, aws, lowlatency
Published: 2023-05-05 23:31:07

A few months back, AWS made an announcement about a new [Direct Connect (DX) location in Auckland](https://aws.amazon.com/about-aws/whats-new/2023/03/aws-direct-connect-auckland-new-zealand/), which was great news for businesses in the region looking to connect their on-prem to AWS. And just last week, AWS launched an [AWS Local Zone in Auckland](https://aws.amazon.com/about-aws/whats-new/2023/05/general-availability-aws-local-zones-auckland/), bringing AWS services even closer to NZ businesses.

One of use case of AWS Local Zones is to deliver single-digit latency. But can the AWS Local Zones really achieve the single-digit latency? As I'm based in Auckland, it's a good opportunity for me to test out Auckland's Local Zone. But before that, let's take a quick review on what is AWS Local Zone, what features does it support and how does the pricing would look like.

# AWS Local Zones Overview
As explained on the [AWS Local Zones User Guide](https://docs.aws.amazon.com/local-zones/latest/ug/what-is-aws-local-zones.html), Local Zone is like a VPC extension of an AWS parent region. As you can see in below diagram, we have Sydney (ap-southeast-2) as a parent region and we extend the VPC into Auckland by creating a subnet in a Local Zone in Auckland (ap-southeast-2-akl-1a)

![AWS Local Zones Architecture](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2s2tnzemsqpwbpdxt29e.png)

[Enabling a Local Zone](https://docs.aws.amazon.com/local-zones/latest/ug/getting-started.html) is pretty straight forward, just go to the the EC2 console (not VPC) and make sure you're in the right region. Then under Account attribute section, go to Zones > select your desired Local Zone > click Manage and enable it.

![AWS Local Zones Settings](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mio8j60674msv81i7lia.png)

Once a Local Zone is enabled in the region, it will be seen like an additional Availability Zone in that region as shown below
![Creating New Subnet in AWS Local Zones](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/urladc09qaxsukwf7jna.png)

# AWS Local Zones Features 
The next question would be, what features are supported in AWS Local Zones? From the [AWS Local Zones Online Tech Talks session](https://youtu.be/gsktWzP_yZw?t=250), it looks like it supports a number of services in LA, but outside of that it's mostly the core compute and networking like EC2, EBS, VPC, and DX.
![AWS Local Zones Online Tech Talks Features](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/52mlqigmtv09tqrlmlko.png)

Link to the latest AWS Local Zones features here: https://aws.amazon.com/about-aws/global-infrastructure/localzones/features/. Just looking at Auckland, it supports EC2 (t3, c5, r5, m5, upcoming g4dn), EBS (gp2 only), standard AWS Shield, ECS, EKS, VPC and DX.
![AWS Local Zones Features](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uab5j97x3fha25cqrnsh.png)

# AWS Local Zones Pricing
It's important to note that the pricing for Local Zones is different from the pricing of the parent region. Let's compare a t3.medium EC2 Linux pricing between Sydney vs Auckland and estimate it for a month usage.

| Location | Instance Type | On-Demand Hourly Rate | Monthly Cost (730 hours) |
| -------- | -------------| ---------------------| ------------ |
| Sydney   | t3.medium    | $0.0528              | $38.54       |
| Auckland | t3.medium    | $0.0713              | $52.05       |

![EC2 pricing Sydney vs Auckland](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g5d1jjfiltifykzh63b2.png)

Another note is that [data transfer charge](https://aws.amazon.com/ec2/pricing/on-demand/#Data_Transfer_within_the_same_AWS_Region) would be different as well, that includes data transfer between a Local Zone and an Availability Zone within the same AWS Region (e.g. Auckland and Sydney)
![Data Transfer Charge](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/obmx37y9fzwy25awod75.png)

# Latency Test and Comparison
Lastly, let's see if it can really deliver a single-digit millisecond latency. I'm going create an EC2 instance in Sydney, an EC2 instance in Auckland, and ping/mtr from my laptop in Auckland.

The diagram below shows the setup and quick ping/mtr test between my laptop and each of the EC2 instances as well as between them.

![Latency Summary](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gzazqy2fefia8y2y1pel.png)

![EC2 Summary](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9znsbezqvbe84zamtxif.png)

![Latency test result](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c9fpp21cgsxd5lxykslm.png)

# Conclusion
If your business in NZ can't leverage AWS Services in Sydney due to latency or perhaps data residency requirements, this AWS Local Zone in Auckland might be worth a look. Make sure to double check the supported AWS services first, as some may only be available in the parent region, and data transfers between Local Zone and parent region Availability Zone may be subject to data transfer charge.

While achieving single-digit latency may not be guaranteed, the Auckland's Local Zone has the potential to significantly improve performance and reduce latency for customers using AWS services from within New Zealand and can't wait for the Auckland Region to launch. In addition, this may be an option for organisations that want to leverage AWS services but don't want to manage physical infrastructure on-prem and can't use existing regions due to latency. Unlike AWS Outpost, the AWS Local Zones don't require customers to host any infrastructure on-premises.