Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS latency between Zones within a same Region

I have an EC2 and RDS in the same region US East(N. Virginia) but both resources are in different zones; RDS in us-east-1a and EC2 in us-east-1b.

Now the question is that if I put both resources within the same zone then would it speed up the data transfer to/from DB? I receive daily around 20k-30k entries from app to this instance.

EDIT

I read here that:

Each Availability Zone is isolated, but the Availability Zones in a region are connected through low-latency links.

Now I am wondering if these low-latency links are very minor or should I consider shifting my resources in the same zone to speed up the data transfer?

enter image description here

Conclusion

As discussed in answers and comments:

  • Since I have only one instance of EC2 and RDS, failure of one service in a zone will affect the whole system. So there is no advantage to keeping them in a separate zone.
  • Even though zones are connected together with low-latency links but there is still some latency which is neglectable in my case.
  • There is also a minor data transfer charge of USD 0.01/GB between EC2 and RDS in different zones.
like image 550
UsamaAmjad Avatar asked Jan 14 '19 22:01

UsamaAmjad


People also ask

How do availability Zones in the same Region different?

Each Region is a separate geographic area. Availability Zones are multiple, isolated locations within each Region. Local Zones provide you the ability to place resources, such as compute and storage, in multiple locations closer to your end users.

What is the distance between AWS availability Zones?

Availability Zones They are fully isolated partitions of the AWS global infrastructure. With its own powerful infrastructure, an Availability Zone is physically separated from any other zones. There is a distance of several kilometers, although all are within 100 km (60 miles of each other).

How do I check my latency on AWS Regions?

The Connection Health Check website quickly checks whether all the required services that use Amazon WorkSpaces can be reached. It also does a performance check to each AWS Region where Amazon WorkSpaces is available, and lets users know which one will be the fastest.

Which AWS service or feature provides high availability and low-latency within an AWS Region?

Amazon EBS provides persistent, highly available, consistent, low-latency block storage volumes for use with Amazon EC2 instances, while Amazon EFS provides simple, scalable, persistent, fully managed cloud file storage for shared access.


2 Answers

What are typical values for Interzone data transfers in the same region?

Although AWS will not guarantee, state, or otherwise commit to hard numbers, typical measurments are sub 10 ms, with numbers around 3 ms is what I have seen.

How does latency affect data transfer throughput?

The higher the latency the lower the maximum bandwidth. There are a number of factors to consider here. An excellent paper was written by Brad Hedlund.

Should I worry about latency in AWS networks between zones in the same region?

Unless you are using the latest instances with very high performance network adapters (10 Gb or higher) I would not worry about it. The benefits of fault tolerance should take precendence except for the most specialized cases.

For your use case, database transactions, the difference between 1 ms and 10 ms will have minimal impact, if at all, on your transaction performance.

However, unless you are using multiple EC2 instances in multiple zones, you want your single EC2 instance in the same zone as RDS. If you are in two zones, the failure of either zone brings down your configuration.

There are times where latency and network bandwidth are very important. For this specialized case, AWS offers placement groups so that the EC2 instances are basically in the same rack close together to minimize latency to the absolute minimum.

like image 51
John Hanley Avatar answered Oct 10 '22 07:10

John Hanley


Moving the resources to the same AZ would decrease latency by very little. See here for some unofficial benchmarks. For your use-case of 20k reads/writes per day, this will NOT make a huge difference.

However, moving resources to the same AZ would significantly increase reliability in your case. If you only have 1 DB and 1 Compute Instance that depend on each other, then there is no reason to put them in separate availability zones. With your current architecture, a failure in either us-east-1a or us-east-1b would bring down your project. Unless you plan on scaling out your project to have multiple DBs and Compute Instances, they should both reside in the same AZ.

like image 38
nareddyt Avatar answered Oct 10 '22 07:10

nareddyt