Using ping to test AWS VPC network latency across different regions
The code for this experiment is available here.
Overview
In the previous article, I discussed my network latency test within a single AWS VPC region. Here in this article, I am going to extend it and test the network latency across different regions.
The below picture is from AWS's official page.
When you application grows to a global scale, you would likely transfer data across different AWS regions. The latency in each pair of AWS regions is important if the data transfer is expected to be in a real-time fashion in your applicaiton.
Test results
Here is my test results sorted by the average ping latency. The values are in milliseconds.
source_region | target_region | avg_value | min_value | max_value |
---|---|---|---|---|
eu-west-3 | eu-west-2 | 9.435 | 9.264 | 11.742 |
eu-west-2 | eu-west-1 | 11.327 | 11.101 | 13.482 |
eu-west-3 | eu-central-1 | 11.61 | 11.512 | 12.073 |
us-east-1 | us-east-2 | 12.319 | 12.039 | 13.999 |
eu-west-2 | eu-central-1 | 15.277 | 15.189 | 15.637 |
ca-central-1 | us-east-1 | 16.914 | 16.801 | 17.228 |
eu-west-3 | eu-west-1 | 18.486 | 18.336 | 19.275 |
us-west-1 | us-west-2 | 19.829 | 19.774 | 19.92 |
eu-north-1 | eu-central-1 | 22.49 | 22.4 | 22.62 |
eu-west-1 | eu-central-1 | 24.893 | 24.69 | 27.299 |
ca-central-1 | us-east-2 | 26.203 | 26.086 | 26.372 |
eu-north-1 | eu-west-3 | 29.117 | 29.034 | 29.19 |
eu-north-1 | eu-west-2 | 33.295 | 33.201 | 33.421 |
ap-northeast-2 | ap-northeast-1 | 34.685 | 34.598 | 34.831 |
eu-north-1 | eu-west-1 | 41.463 | 41.335 | 41.632 |
us-east-2 | us-west-1 | 51.996 | 51.922 | 52.194 |
ap-south-1 | ap-southeast-1 | 54.024 | 53.763 | 57.17 |
us-east-1 | us-west-1 | 62.111 | 62.029 | 62.57 |
ca-central-1 | us-west-2 | 67.995 | 67.881 | 68.437 |
us-east-2 | us-west-2 | 68.087 | 68.038 | 68.206 |
us-east-1 | us-west-2 | 72.115 | 72.062 | 72.229 |
ap-northeast-1 | ap-southeast-1 | 72.12 | 71.978 | 73.087 |
eu-west-1 | ca-central-1 | 74.921 | 74.746 | 76.1 |
eu-west-1 | us-east-1 | 75.975 | 75.873 | 76.196 |
eu-west-2 | us-east-1 | 76.702 | 76.655 | 76.807 |
eu-west-1 | us-east-2 | 77.896 | 77.82 | 78.231 |
ca-central-1 | us-west-1 | 78.56 | 78.493 | 78.863 |
eu-west-3 | us-east-1 | 79.748 | 79.633 | 80.989 |
eu-west-2 | us-east-2 | 86.559 | 86.12 | 92.064 |
eu-central-1 | us-east-1 | 87.959 | 87.845 | 88.928 |
eu-west-2 | ca-central-1 | 89.175 | 89.059 | 89.974 |
eu-west-3 | us-east-2 | 89.567 | 89.449 | 90.026 |
eu-west-3 | ca-central-1 | 93.43 | 93.369 | 93.513 |
eu-central-1 | us-east-2 | 96.971 | 96.878 | 97.487 |
ap-northeast-2 | ap-southeast-1 | 99.221 | 99.112 | 99.344 |
ap-northeast-1 | us-west-2 | 99.467 | 99.347 | 99.597 |
ca-central-1 | eu-central-1 | 100.571 | 100.488 | 100.858 |
ap-northeast-1 | ap-southeast-2 | 106.454 | 106.388 | 106.589 |
ap-south-1 | eu-west-3 | 106.954 | 106.752 | 110.041 |
eu-north-1 | us-east-1 | 107.357 | 107.242 | 108.174 |
ap-northeast-1 | us-west-1 | 111.731 | 111.609 | 111.88 |
ap-south-1 | eu-central-1 | 112.079 | 111.866 | 115.644 |
ap-south-1 | eu-west-2 | 113.049 | 112.827 | 115.494 |
eu-north-1 | ca-central-1 | 113.971 | 113.88 | 114.087 |
eu-north-1 | us-east-2 | 116.8 | 116.722 | 116.862 |
ap-south-1 | eu-west-1 | 122.206 | 122.108 | 122.618 |
sa-east-1 | ca-central-1 | 122.727 | 122.639 | 122.962 |
ap-south-1 | ap-northeast-1 | 124.042 | 123.918 | 124.656 |
ap-northeast-2 | us-west-2 | 127.332 | 127.145 | 128.243 |
eu-north-1 | ap-south-1 | 131.514 | 131.409 | 131.718 |
eu-west-1 | us-west-2 | 131.737 | 131.68 | 131.847 |
ap-northeast-2 | ap-southeast-2 | 134.009 | 133.899 | 134.261 |
eu-west-2 | us-west-1 | 136.79 | 136.623 | 139.716 |
eu-west-2 | us-west-2 | 137.377 | 137.327 | 137.524 |
ap-southeast-2 | us-west-2 | 137.986 | 137.919 | 138.092 |
eu-west-3 | us-west-1 | 138.496 | 138.436 | 138.636 |
ap-northeast-2 | us-west-1 | 139.89 | 139.563 | 142.783 |
sa-east-1 | us-east-1 | 140.855 | 140.798 | 141.002 |
eu-west-1 | us-west-1 | 141.553 | 141.375 | 143.441 |
eu-central-1 | us-west-1 | 146.286 | 146.191 | 146.563 |
eu-west-3 | us-west-2 | 147.916 | 147.704 | 150.489 |
sa-east-1 | us-east-2 | 150.637 | 150.559 | 150.762 |
ap-southeast-2 | us-west-1 | 150.762 | 150.621 | 151.54 |
ap-northeast-1 | us-east-1 | 152.693 | 152.546 | 152.954 |
ap-south-1 | ap-northeast-2 | 153.521 | 153.074 | 157.473 |
ap-northeast-1 | ca-central-1 | 156.348 | 156.258 | 156.554 |
eu-central-1 | us-west-2 | 157.993 | 157.882 | 158.226 |
ap-northeast-1 | us-east-2 | 158.274 | 158.174 | 158.828 |
ap-southeast-1 | us-west-2 | 163.188 | 163.128 | 163.245 |
eu-north-1 | us-west-2 | 165.754 | 165.641 | 166.06 |
eu-west-3 | ap-southeast-1 | 165.951 | 165.861 | 166.31 |
eu-west-2 | ap-southeast-1 | 166.857 | 166.69 | 169.289 |
eu-north-1 | us-west-1 | 166.903 | 166.616 | 170.379 |
ap-southeast-1 | eu-central-1 | 170.72 | 170.64 | 171.291 |
eu-west-1 | ap-southeast-1 | 175.214 | 175.112 | 175.671 |
ap-southeast-1 | us-west-1 | 175.532 | 174.633 | 198.092 |
ap-northeast-2 | us-east-1 | 176.618 | 176.539 | 176.772 |
eu-west-1 | sa-east-1 | 179.883 | 179.769 | 180.6 |
ap-south-1 | us-east-1 | 181.932 | 181.832 | 182.253 |
sa-east-1 | us-west-2 | 184.524 | 184.442 | 184.626 |
eu-north-1 | ap-southeast-1 | 184.94 | 184.869 | 185.037 |
ap-northeast-2 | us-east-2 | 185.384 | 185.269 | 185.545 |
ap-northeast-2 | ca-central-1 | 185.495 | 185.337 | 186.947 |
ap-southeast-1 | ap-southeast-2 | 187.683 | 187.403 | 191.223 |
ap-southeast-2 | us-east-2 | 194.336 | 194.106 | 196.131 |
ap-south-1 | ca-central-1 | 194.342 | 194.256 | 194.473 |
ap-south-1 | us-east-2 | 195.138 | 195.063 | 195.263 |
sa-east-1 | us-west-1 | 196.044 | 195.023 | 196.941 |
ap-southeast-2 | us-east-1 | 198.82 | 198.766 | 199.157 |
ca-central-1 | ap-southeast-2 | 209.585 | 209.341 | 211.664 |
ap-south-1 | us-west-2 | 211.279 | 211.199 | 211.392 |
eu-west-2 | ap-northeast-1 | 215.736 | 215.658 | 215.869 |
eu-west-2 | sa-east-1 | 217.074 | 216.929 | 218.18 |
eu-west-1 | ap-northeast-1 | 217.856 | 217.768 | 218.055 |
eu-west-3 | sa-east-1 | 218.02 | 216.94 | 227.153 |
ca-central-1 | ap-southeast-1 | 220.046 | 219.949 | 220.592 |
ap-southeast-1 | us-east-2 | 222.829 | 222.744 | 223.209 |
ap-south-1 | ap-southeast-2 | 223.823 | 223.703 | 224.632 |
eu-west-3 | ap-northeast-1 | 225.934 | 225.815 | 227.104 |
ap-southeast-1 | us-east-1 | 226.586 | 226.458 | 227.522 |
ap-south-1 | us-west-1 | 227.668 | 227.593 | 227.789 |
sa-east-1 | eu-central-1 | 228.214 | 228.142 | 228.279 |
ap-northeast-1 | eu-central-1 | 231.089 | 229.141 | 231.571 |
eu-west-2 | ap-northeast-2 | 240.581 | 240.326 | 240.731 |
eu-west-1 | ap-northeast-2 | 243.391 | 243.294 | 244.227 |
eu-north-1 | ap-northeast-1 | 245.055 | 244.871 | 247.834 |
eu-north-1 | sa-east-1 | 245.18 | 245.079 | 245.736 |
eu-west-3 | ap-northeast-2 | 253.109 | 253.038 | 253.254 |
eu-west-1 | ap-southeast-2 | 259.148 | 258.969 | 260.803 |
ap-northeast-2 | eu-central-1 | 264.326 | 264.126 | 266.897 |
eu-west-2 | ap-southeast-2 | 270.051 | 268.612 | 270.192 |
eu-north-1 | ap-northeast-2 | 270.692 | 270.594 | 270.793 |
ap-northeast-1 | sa-east-1 | 273.182 | 273.047 | 274.608 |
eu-west-3 | ap-southeast-2 | 275.802 | 275.727 | 276.025 |
ap-southeast-2 | eu-central-1 | 283.567 | 283.419 | 283.896 |
ap-northeast-2 | sa-east-1 | 297.738 | 297.561 | 300.804 |
eu-north-1 | ap-southeast-2 | 301.866 | 301.79 | 301.931 |
sa-east-1 | ap-southeast-2 | 315.08 | 315.025 | 315.151 |
ap-south-1 | sa-east-1 | 321.132 | 320.986 | 322.404 |
sa-east-1 | ap-southeast-1 | 340.949 | 340.515 | 347.95 |
The test structure and VPC peering
Let me briefly explain VPC peering in AWS which I used for this testing.
When your application transfers data across regions, for example, in order to replicate data across regions, you would likely to do it through AWS's internal network instead of sending data over the public internet.
VPC peering in AWS allows the inter-region data transfer within AWS:
https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html
A VPC peering connection ... enables you to route traffic between them using private IPv4 addresses or IPv6 addresses ... Traffic always stays on the global AWS backbone, and never traverses the public internet
In this test, I measured ping latency across AWS regions using VPC peering.
Matt Adorjan's AWS Inter-Region Latency
There is another, actually a better source of AWS network latency information.
While writing this article, I found "AWS Inter-Region Latency" at https://www.cloudping.co which covers more comprehensive combinations of regions.
He used DynamoDB endpoints, so it is somewhat different from my test, but anyway his coverage on the region pairs is more comprehensive, so it's worth checking out. Please look at his GitHub repo (I already gave a star to it!).
It was a good learning opportunity to me. Kudos to Matt.
References
https://aws.amazon.com/about-aws/global-infrastructure/ https://aws.amazon.com/about-aws/global-infrastructure/regions_az/