AWS香港を含む17リージョンのEC2を利用して、AWSリージョン間のネットワーク遅延を測定してみた

2019.04.28

この記事は公開されてから1年以上経過しています。情報が古い可能性がありますので、ご注意ください。

はじめに

AWSチームのすずきです。

2019/4/24 に利用可能となったAWS香港リージョンのネットワーク性能を確認するため、 EC2インスタンスから、S3のエンドポイントのping応答性能を、 利用可能なリージョン間で測定する機会がありましたので紹介させていただきます。

AWS香港リージョンのEC2を試してみた

測定方法

  • インスタンスタイプ: 「m5.large」
  • AMI: Amazon Linux 2 (最新)
  • VPC: デフォルトVPC (パブリックIP有効)
  • 各リージョンのS3のエンドポイントに対し、ping -c 10 を実施、集計行のmin/avg/max/mdev 値を抽出

S3エンドポイント

AWS のリージョンとエンドポイント

  • Amazon Simple Storage Service (Amazon S3) として公開されているエンドポイントを利用しました。

コマンド

$ REGION='ap-northeast-1'
$ ENDPOINT="s3.${REGION}.amazonaws.com"
$ ping ${ENDPOINT} -c 10
PING s3.ap-northeast-1.amazonaws.com (52.219.68.104) 56(84) bytes of data.
64 bytes from s3-ap-northeast-1.amazonaws.com (52.219.68.104): icmp_seq=1 ttl=60 time=2.29 ms
(略)
64 bytes from s3-ap-northeast-1.amazonaws.com (52.219.68.104): icmp_seq=10 ttl=60 time=2.39 ms
--- s3.ap-northeast-1.amazonaws.com ping statistics ---
10 packets transmitted, 10 received, 0% packet loss, time 9013ms
rtt min/avg/max/mdev = 2.292/2.353/2.397/0.051 ms

結果

  • 東京と香港リージョンで起動したEC2から、各リージョンのS3エンドポイントへのping応答は以下の通りでした。

東京リージョン

リージョン min avg max stddev
ap-northeast-1 0.082 0.091 0.108 0.012
ap-northeast-3 6.37 6.381 6.4 0.051
ap-northeast-2 32.256 32.322 32.825 0.282
ap-east-1 53.761 54.921 55.432 0.767
ap-southeast-1 67.973 68 68.105 0.04
cn-northwest-1 78.357 78.512 78.747 0.302
cn-north-1 99.769 99.848 99.966 0.418
us-west-2 102.306 102.333 102.396 0.351
us-west-1 108.343 108.688 109.043 0.494
ap-southeast-2 128.719 128.727 128.747 0.32
ap-south-1 132.973 134.533 135.214 1.031
ca-central-1 154.525 154.536 154.546 0.43
us-east-2 155.833 157.155 168.851 3.914
us-east-1 164.117 166.718 167.874 1.497
eu-west-1 222.469 223.548 224.649 1.067
eu-west-2 229.78 230.132 231.5 0.859
eu-west-3 232.991 233.096 233.183 0.38
eu-central-1 238.963 238.974 238.986 0.488
eu-north-1 258.495 258.502 258.51 0.643
sa-east-1 269.204 269.223 269.244 0.614

香港リージョン

リージョン min avg max stddev
ap-east-1 0.565 0.568 0.573 0.018
ap-southeast-1 31.55 31.556 31.563 0.194
ap-northeast-2 34.302 35.11 35.216 0.368
ap-northeast-3 38.243 38.249 38.264 0.123
ap-northeast-1 47.366 47.561 48.009 0.412
ap-south-1 91.031 92.706 94.388 1.721
cn-north-1 110 110.861 111.286 0.327
us-west-2 139.498 139.879 140.141 0.454
us-west-1 153.389 153.399 153.42 0.35
ap-southeast-2 159.33 159.336 159.343 0.309
eu-west-2 193.536 194.043 194.427 0.662
eu-central-1 194.609 194.622 194.674 0.279
eu-west-3 195.931 195.941 195.961 0.523
ca-central-1 200.235 200.245 200.252 0.283
us-east-1 211.758 212.446 214.046 1.066
cn-northwest-1 189.601 213.702 228.802 12.238
us-east-2 203.39 213.709 220.439 8.181
eu-north-1 223.028 223.597 223.975 0.548
eu-west-1 260.11 261.525 262.137 1.056
sa-east-1 309.574 309.589 309.642 0.704

全リージョン

EC2インスタンスを起動する事ができたリージョンから、各リージョンのS3エンドポイントのPing応答結果の平均値を一覧化しました。

リージョン (S3\EC2) ap-northeast-1 ap-northeast-2 ap-east-1 ap-southeast-1 us-west-2 us-west-1 ap-southeast-2 ap-south-1 ca-central-1 us-east-2 us-east-1 eu-west-1 eu-west-2 eu-west-3 eu-central-1 eu-north-1 sa-east-1
ap-northeast-1 0.091 32.901 47.561 69.255 97.878 109.288 129.48 134.702 154.641 155.631 164.726 219.044 233.23 235.231 238.357 261.556 270.713
ap-northeast-3 6.381 38.184 38.249 65.877 95.94 109.146 121.283 115.423 167.261 158.142 169.171 223.164 235.378 233.8 234.107 253.577 272.553
ap-northeast-2 32.322 0.969 35.11 96.373 129.598 137.444 158.188 156.352 182.016 183.651 187.837 245.213 258.929 263.042 266.202 289.822 298.263
ap-east-1 54.921 36.216 0.568 31.25 141.995 153.922 159.036 88.997 203.741 203.964 214.45 265.929 198.351 191.787 198.436 224.038 316.106
ap-southeast-1 68 96.009 31.556 0.974 162.872 174.155 187.271 58.754 218.972 219.564 243.728 182.579 175.077 166.308 167.732 193.456 334.302
cn-northwest-1 78.512 111.892 213.702 163.146 205.378 175.602 278.4 216.422 354.208 243.835 233.293 343.502 235.993 332.916 179.04 242.35 462.785
cn-north-1 99.848 86.918 110.861 174.538 241.94 164.897 256.997 264.72 241.716 319.976 230.98 199.824 245.571 210.368 207.253 198.312 356.787
us-west-2 102.333 126.989 139.879 161.195 0.105 22.079 138.278 213.417 65.679 69.785 77.836 132.65 143.495 148.216 156.678 174.431 182.701
us-west-1 108.688 136.675 153.399 173.917 20.551 0.125 148.95 231.877 78.313 50.854 60.657 144.985 136.411 136.804 145.325 166.879 192.039
ap-southeast-2 128.727 159.212 159.336 187.029 137.673 149.017 0.729 236.58 207.523 193.884 198.599 265.194 269.918 272.709 281.15 299.693 314.911
ap-south-1 134.533 157.19 92.706 62.22 225.177 237.078 240.309 0.52 195.409 195.058 181.877 121.425 111.538 104.981 111.601 130.383 319.926
ca-central-1 154.536 182.462 200.245 219.104 65.825 78.341 208.936 198.001 0.068 25.136 15.204 73.919 87.011 91.947 100.709 113.441 123.15
us-east-2 157.155 197.45 213.709 219.337 68.906 51.659 201.94 193.344 25.022 0.614 10.859 78.648 90.135 89.901 99.23 117.989 156.573
us-east-1 166.718 189.428 212.446 245.338 79.199 61.825 197.756 185.119 16.088 11.27 0.56 72.401 75.748 78.206 86.631 105.482 140.046
eu-west-1 223.548 248.409 261.525 174.801 136.993 146.445 266.515 121.981 74.519 77.235 70.593 0.441 10.471 17.43 22.396 39.709 183.841
eu-west-2 230.132 260.175 194.043 173.388 143.622 136.786 268.453 112.332 86.127 85.24 74.941 10.027 0.064 8.38 13.244 31.864 213.339
eu-west-3 233.096 261.447 195.941 161.788 150.961 137.897 274.23 103.457 91.545 88.889 78.732 16.83 7.825 0.07 9.385 30.254 218.497
eu-central-1 238.974 267.082 194.622 172.735 161.74 146.896 282.243 111.828 101.073 98.439 87.205 20.502 17.075 10.018 0.111 22.451 225.686
eu-north-1 258.502 286.978 223.597 187.081 171.847 167.805 299.477 131.318 114.124 116.274 106.736 42.795 32.09 28.583 22.353 0.06 245.469
sa-east-1 269.223 297.885 309.589 335.078 181.75 192.148 314.341 325.509 123.843 153.613 141.234 183.846 212.916 220.945 228.828 248.364 0.127

コマンド

  • EC2起動時に「UserData」を利用して測定を行いました。
#!/bin/bash -xe
S3BUCKET='xxxxxxxx'

hostname > /tmp/$$.txt
REGIONS=(us-east-2 us-east-1 us-west-1 us-west-2 ap-east-1 ap-south-1 ap-northeast-3 ap-northeast-2 ap-southeast-1 ap-southeast-2 ap-northeast-1 ca-central-1 eu-central-1 eu-west-1 eu-west-2 eu-west-3 eu-north-1 sa-east-1 )
for REGION in "${REGIONS[@]}" ; do
  ENDPOINT="s3.${REGION}.amazonaws.com"
  ping ${ENDPOINT} -c 10 > /tmp/$$.tmp
  TMP=`tail -1 /tmp/$$.tmp | cut -f 4 -d ' ' | cut -f 2 -d / `
  echo "${REGION} ${TMP}" >> /tmp/$$.txt
done

REGIONS=(cn-north-1 cn-northwest-1)
for REGION in "${REGIONS[@]}" ; do
  ENDPOINT="s3.${REGION}.amazonaws.com.cn"
  ping ${ENDPOINT} -c 10 > /tmp/$$.tmp
  TMP=`tail -1 /tmp/$$.tmp | cut -f 4 -d ' ' | cut -f 2 -d / `
  echo "${REGION} ${TMP}" >> /tmp/$$.txt
done
cat /tmp/$$.txt

aws s3 cp /tmp/$$.txt s3://${S3BUCKET}/`hostname`
shutdown -h now

まとめ

2019年4月に利用可能となった香港リージョン(ap-east-1)、東京リージョン(ap-northeast-1)からのネットワーク的な距離は、 ソウル(ap-northeast-2) より遠く、シンガポール(ap-southeast-1)より近い事がわかりました。

中国国内からAWS香港リージョンへのインターネット接続は、金盾(Great Firewall)の影響を受ける可能性はありますが、 香港に隣接している深センなどからは低遅延なネットワーク接続が期待できると思われます。

尚、今回の計測は1台のEC2から30秒程度、ICMPの応答結果のみ測定した簡易なものです。

利用するプロトコルや、キープアライブなどにより実際のネットワーク性能は大きく上下する可能性があります。 複数リージョンを利用するシステムを展開される際には、実際のワークロードを再現した適切な性能評価をお試しください。