What is AWS EC2 cross availability zones network lag vs inside same zone?
Simple setup: 4 EC2 instances:
- Inside eu-west-1a
- Inside eu-west-1a (again)
- Inside eu-west-1b
- Inside eu-west-1c
The seconds instance inside eu-west-1a will be target all instances will ping to using private EC2 instance IP. All EC2 instances are on same account, same VPC, same t2.micro fresh instances with ubuntu.
Ping results after pinging for 5 minutes at same time from 2nd instance to other 3:
Latency inside & cross AZs averaged <1ms, yet some request cross-AZ during these 5 minutes jumped up to 12.3ms, averaged at 0.82–0.83ms.
While lag is pretty low cross-AZs, yet as expected, inside same Availability Zone connection is more consistent, standard deviation is much lower.
Notes for running on single AZ:
- pricing of spot instances may differ between AZs
- availability of EC2 types may differ between AZs
- In single-region setup, 99% uptime SLA uses 1 AZ, meanwhile 99.99% — 3 AZs. Read more here: https://docs.aws.amazon.com/wellarchitected/latest/reliability-pillar/single-region-scenarios.html