こんにちは。森(@mosuke5)です。 フォルダを漁っていたら過去のまとめがでてきたので、せっかくなので公開してみました。
ECSはネットワーク帯域(EIP帯域)をオンラインで変更できます(※Pay As You Goかつrunningまたはstopステータス)。この機能の操作感について確認を行いました。なお、ECSのネットワーク通信に係る課金ロジックは容量課金に統一されているため、帯域を変更する要件としては、通信量の増大を抑止したい場合やベンチマーク用途が想定されます。
検証環境
今回、日本リージョンの同一VPC内の2台のECSにて検証を行いました。EIP経由でiperf3コマンドにより通信パフォーマンスの計測を行いつつ、帯域の変更をAPIから行います。
検証結果
初期状態でのパフォーマンス
まずは、100Mbps状態でのパフォーマンスを計測します。100Mbps程度で帯域抑制がかかっていることが確認できます。
[root@iz6we6pz0ajdqjsvn6xlzoz ~]# iperf3 -c 47.91.16.104 Connecting to host 47.91.16.104, port 5201 [ 4] local 172.24.0.12 port 52924 connected to 47.91.16.104 port 5201 [ ID] Interval Transfer Bandwidth Retr Cwnd [ 4] 0.00-1.00 sec 26.9 MBytes 225 Mbits/sec 1604 283 KBytes [ 4] 1.00-2.00 sec 13.0 MBytes 109 Mbits/sec 1192 314 KBytes [ 4] 2.00-3.00 sec 12.8 MBytes 107 Mbits/sec 1231 247 KBytes [ 4] 3.00-4.00 sec 10.5 MBytes 88.1 Mbits/sec 911 368 KBytes [ 4] 4.00-5.00 sec 12.4 MBytes 104 Mbits/sec 1012 250 KBytes [ 4] 5.00-6.00 sec 13.1 MBytes 110 Mbits/sec 1082 129 KBytes [ 4] 6.00-7.00 sec 13.0 MBytes 109 Mbits/sec 968 9.90 KBytes [ 4] 7.00-8.00 sec 10.5 MBytes 88.1 Mbits/sec 832 212 KBytes [ 4] 8.00-9.00 sec 13.4 MBytes 113 Mbits/sec 1212 43.8 KBytes [ 4] 9.00-10.00 sec 11.7 MBytes 98.0 Mbits/sec 832 283 KBytes - - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval Transfer Bandwidth Retr [ 4] 0.00-10.00 sec 137 MBytes 115 Mbits/sec 10876 sender [ 4] 0.00-10.00 sec 133 MBytes 112 Mbits/sec receiver iperf Done. [root@iz6we6pz0ajdqjsvn6xlzoz ~]# iperf3 -c 47.91.16.104 Connecting to host 47.91.16.104, port 5201 [ 4] local 172.24.0.12 port 52928 connected to 47.91.16.104 port 5201 [ ID] Interval Transfer Bandwidth Retr Cwnd [ 4] 0.00-1.00 sec 27.0 MBytes 226 Mbits/sec 1475 315 KBytes [ 4] 1.00-2.00 sec 13.5 MBytes 114 Mbits/sec 1342 9.90 KBytes [ 4] 2.00-3.00 sec 10.7 MBytes 89.7 Mbits/sec 1008 277 KBytes [ 4] 3.00-4.00 sec 13.1 MBytes 110 Mbits/sec 1164 230 KBytes [ 4] 4.00-5.00 sec 10.8 MBytes 90.2 Mbits/sec 995 243 KBytes [ 4] 5.00-6.00 sec 13.0 MBytes 109 Mbits/sec 1291 366 KBytes [ 4] 6.00-7.00 sec 12.3 MBytes 103 Mbits/sec 1145 46.7 KBytes [ 4] 7.00-8.00 sec 13.4 MBytes 112 Mbits/sec 1015 281 KBytes [ 4] 8.00-9.00 sec 11.2 MBytes 94.4 Mbits/sec 995 313 KBytes [ 4] 9.00-10.00 sec 13.1 MBytes 110 Mbits/sec 1354 170 KBytes - - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval Transfer Bandwidth Retr [ 4] 0.00-10.00 sec 138 MBytes 116 Mbits/sec 11784 sender [ 4] 0.00-10.00 sec 134 MBytes 113 Mbits/sec receiver
APIによる速度設定変更
APIによる速度変更は、ModifyInstanceNetworkSpecインターフェースによってい行います。まずは、変更前の状態を確認します。現状、InternetMaxBandwidthOutが100の状態です。(インターネットアウトの帯域幅が100M)
# aliyun ecs DescribeInstanceAttribute --InstanceId i-6we6pz0ajdqjsvn6xlzo { "Status": "Running", "Description": "", "InstanceId": "i-6we6pz0ajdqjsvn6xlzo", "HostName": "iZ6we6pz0ajdqjsvn6xlzoZ", "ClusterId": "", "ImageId": "centos7u2_64_40G_cloudinit_20160728.raw", "InstanceChargeType": "PostPaid", "InstanceNetworkType": "vpc", "InstanceType": "ecs.n4.small", "EipAddress": { "InternetChargeType": "", "Bandwidth": 100, ←ここ "IpAddress": "47.91.19.124", "AllocationId": "" }, "InnerIpAddress": { "IpAddress": [] }, "OperationLocks": { "LockReason": [] }, "SecurityGroupIds": { "SecurityGroupId": [ "sg-6we4mz253purtsqowdp1" ] },
VPC環境なので、EIP側の帯域制限設定がインターネット通信に適応されます。aliyunコマンドにより20Mbpsに変更を行います。
# aliyun ecs ModifyInstanceNetworkSpec --InstanceId i-6we6pz0ajdqjsvn6xlzo --InternetMaxBandwidthOut 20 { "RequestId": "D4398807-924E-48C6-8630-3B885A4D4070" } # aliyun ecs DescribeInstanceAttribute --InstanceId i-6we6pz0ajdqjsvn6xlzo { "Status": "Running", "Description": "", "InstanceId": "i-6we6pz0ajdqjsvn6xlzo", "HostName": "iZ6we6pz0ajdqjsvn6xlzoZ", "ClusterId": "", "ImageId": "centos7u2_64_40G_cloudinit_20160728.raw", "InstanceChargeType": "PostPaid", "InstanceNetworkType": "vpc", "InstanceType": "ecs.n4.small", "EipAddress": { "InternetChargeType": "", "Bandwidth": 20, ←ここ "IpAddress": "47.91.19.124", "AllocationId": "" }, "InnerIpAddress": { "IpAddress": [] }, "OperationLocks": { "LockReason": [] }, "SecurityGroupIds": { "SecurityGroupId": [ "sg-6we4mz253purtsqowdp1" ] },
変更された状態で、再度iperf3によるパフォーマンス計測を行うと、20Mbpsでの制限が反映されていることが分かる。
[root@iz6we6pz0ajdqjsvn6xlzoz ~]# iperf3 -c 47.91.16.104 Connecting to host 47.91.16.104, port 5201 [ 4] local 172.24.0.12 port 52932 connected to 47.91.16.104 port 5201 [ ID] Interval Transfer Bandwidth Retr Cwnd [ 4] 0.00-1.00 sec 5.98 MBytes 50.1 Mbits/sec 316 107 KBytes [ 4] 1.00-2.00 sec 2.67 MBytes 22.4 Mbits/sec 255 91.9 KBytes [ 4] 2.00-3.00 sec 2.36 MBytes 19.8 Mbits/sec 277 60.8 KBytes [ 4] 3.00-4.00 sec 2.67 MBytes 22.4 Mbits/sec 208 31.1 KBytes [ 4] 4.00-5.00 sec 2.17 MBytes 18.2 Mbits/sec 287 21.2 KBytes [ 4] 5.00-6.00 sec 2.98 MBytes 25.0 Mbits/sec 237 91.9 KBytes [ 4] 6.00-7.00 sec 2.30 MBytes 19.3 Mbits/sec 219 86.3 KBytes [ 4] 7.00-8.00 sec 2.86 MBytes 24.0 Mbits/sec 244 86.3 KBytes [ 4] 8.00-9.00 sec 2.67 MBytes 22.4 Mbits/sec 287 59.4 KBytes [ 4] 9.00-10.00 sec 2.42 MBytes 20.3 Mbits/sec 178 84.8 KBytes - - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval Transfer Bandwidth Retr [ 4] 0.00-10.00 sec 29.1 MBytes 24.4 Mbits/sec 2508 sender [ 4] 0.00-10.00 sec 28.1 MBytes 23.6 Mbits/sec receiver iperf Done. [root@iz6we6pz0ajdqjsvn6xlzoz ~]# iperf3 -c 47.91.16.104 Connecting to host 47.91.16.104, port 5201 [ 4] local 172.24.0.12 port 52936 connected to 47.91.16.104 port 5201 [ ID] Interval Transfer Bandwidth Retr Cwnd [ 4] 0.00-1.00 sec 5.94 MBytes 49.8 Mbits/sec 392 91.9 KBytes [ 4] 1.00-2.00 sec 2.61 MBytes 21.9 Mbits/sec 285 72.1 KBytes [ 4] 2.00-3.00 sec 2.86 MBytes 24.0 Mbits/sec 263 55.1 KBytes [ 4] 3.00-4.00 sec 2.55 MBytes 21.4 Mbits/sec 219 58.0 KBytes [ 4] 4.00-5.00 sec 2.17 MBytes 18.2 Mbits/sec 204 65.0 KBytes [ 4] 5.00-6.00 sec 2.67 MBytes 22.4 Mbits/sec 233 38.2 KBytes [ 4] 6.00-7.00 sec 2.86 MBytes 24.0 Mbits/sec 289 17.0 KBytes [ 4] 7.00-8.00 sec 2.42 MBytes 20.3 Mbits/sec 173 86.3 KBytes [ 4] 8.00-9.00 sec 2.49 MBytes 20.9 Mbits/sec 243 83.4 KBytes [ 4] 9.00-10.00 sec 2.49 MBytes 20.9 Mbits/sec 243 80.6 KBytes - - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval Transfer Bandwidth Retr [ 4] 0.00-10.00 sec 29.1 MBytes 24.4 Mbits/sec 2544 sender [ 4] 0.00-10.00 sec 27.9 MBytes 23.4 Mbits/sec receiver
変更タイミングについての確認
APIによる速度変更の反映タイミングを確認するために、パフォーマンステストを行っている最中に変更をかけてみました。結果、変更はほぼ即時に反映される(通信中のセッションにも速度変更は反映される)ことが確認されました。
[root@iz6we6pz0ajdqjsvn6xlzoz ~]# iperf3 -c 47.91.16.104 Connecting to host 47.91.16.104, port 5201 [ 4] local 172.24.0.12 port 52952 connected to 47.91.16.104 port 5201 [ ID] Interval Transfer Bandwidth Retr Cwnd [ 4] 0.00-1.00 sec 27.3 MBytes 229 Mbits/sec 1623 287 KBytes [ 4] 1.00-2.00 sec 13.2 MBytes 111 Mbits/sec 1279 158 KBytes [ 4] 2.00-3.00 sec 10.6 MBytes 88.6 Mbits/sec 894 36.8 KBytes [ 4] 3.00-4.00 sec 13.4 MBytes 112 Mbits/sec 1059 389 KBytes [ 4] 4.00-5.00 sec 11.6 MBytes 97.0 Mbits/sec 1126 215 KBytes [ 4] 5.00-6.00 sec 8.58 MBytes 71.9 Mbits/sec 895 1.41 KBytes ※ここまで100Mbps [ 4] 6.00-7.00 sec 2.61 MBytes 21.9 Mbits/sec 495 1.41 KBytes ※ここから20Mbps [ 4] 7.00-8.00 sec 3.11 MBytes 26.1 Mbits/sec 405 79.2 KBytes [ 4] 8.00-9.00 sec 2.67 MBytes 22.4 Mbits/sec 253 35.4 KBytes [ 4] 9.00-10.00 sec 2.49 MBytes 20.8 Mbits/sec 166 1.41 KBytes - - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval Transfer Bandwidth Retr [ 4] 0.00-10.00 sec 95.5 MBytes 80.1 Mbits/sec 8195 sender [ 4] 0.00-10.00 sec 91.5 MBytes 76.8 Mbits/sec receiver
サブスクリプションECSのネットワーク速度は変更できるか
ここまでの試験ではPay As You Goインスタンスを対象として確認を行ってきたが、サブスクリプション(PrePaid)インスタンスについては、速度変更はできません。もし、変更したい場合には、グローバルIPアドレスをEIPのサービスを使って付与するとダイナミックに変更することが可能です。(デフォルトで付与されているグローバルアドレスをEIPにあとから変更することも可能です)
[root@55de15d2893d]/# aliyuncli ecs ModifyInstanceNetworkSpec --InstanceId i-6wehhcrpm33xd8fqfrym --InternetMaxBandwidthOut 100 { "Code": "OperationDenied", "Message": "The operation is denied due to the instance is PrePaid.", "HostId": "ecs.ap-northeast-1.aliyuncs.com", "RequestId": "2D745500-FCB9-4531-94EB-E6EAF1133438" }
さいごに
PostPaid/Pay As You Goで購入したECSのインターネット速度(送信速度)反映はほぼリアルタイムで行われることがわかります。