21

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.
UsamaAmjad
  • 4,175
  • 3
  • 28
  • 35

3 Answers3

16

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.

John Hanley
  • 74,467
  • 6
  • 95
  • 159
  • 4
    There is also a minor data transfer charge of USD 0.01 per gigabyte between EC2 and RDS instances in different AZs. Probably immaterial in this case but worth considering if large data volumes are being transferred. See https://aws.amazon.com/ec2/pricing/on-demand/ – shonky linux user Jan 15 '19 at 00:22
  • 2
    @shonkylinuxuser - network pricing is always important to watch. Notice that RDS is missing from this list. `Data transferred between Amazon S3, Amazon Glacier, Amazon DynamoDB, Amazon SES, Amazon SQS, Amazon Kinesis, Amazon ECR, Amazon SNS or Amazon SimpleDB and Amazon EC2 instances in the same AWS Region is free.` – John Hanley Jan 15 '19 at 00:33
  • Note, placement group "cluster" which puts EC2s closest together do not support any "burstable" instance types - t2.*, t3.*, t4.* etc. So no cheapos there. – Lukas Liesis Nov 29 '22 at 12:41
7

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.

nareddyt
  • 1,016
  • 10
  • 20
0

According to some tests, i can see like 600 microseconds (0.6 ms) latency between availability zones, inside the same region. A fiber has 5 microseconds delay (latency) per km, and between azs there is less than 100km, hence the result matches.

NicuMarasoiu
  • 776
  • 9
  • 25