今回の記事は、以下のドキュメントがベースです。
読んで頂くとわかると思いますが、SR-IOV が効いた NIC を使えるようになったって話です。
SR-IOVとは
SR-IOV については、以下のサイトの情報が参考になると思います。

要約しちゃうと、
複数の仮想マシンから送られてきた1つのPCIデバイスへのI/O要求を,ハイパーバイザがデバイスと仮想マシン間に入ってソフトウェア処理をしていたのを、デバイス側で処理をしてしまうといったものです。
だから、性能が出るんですね。
VM が Windows 環境(Azure PowerShell)
VM が Windows 環境の場合は、Azure PowerShell で構成するチュートリアルを見るのがいいと思います。
Create a Windows virtual machine with Accelerated Networking
自分がざっくりと試したスクリプトはこんな感じっす。
$rgname = "testvm01"
$vmlocation = "centralus"
New-AzureRmResourceGroup -Name $rgname -Location $vmlocation
$subnetname = "mySubnet"
$subnet = New-AzureRmVirtualNetworkSubnetConfig `
-Name $subnetname `
-AddressPrefix "192.168.1.0/24"
$vnetname = "testvmvnet01"
$vnet = New-AzureRmVirtualNetwork -ResourceGroupName $rgname `
-Location $vmlocation `
-Name "myVnet" `
-AddressPrefix "192.168.0.0/16" `
-Subnet $Subnet
$rdp = New-AzureRmNetworkSecurityRuleConfig `
-Name 'Allow-RDP-All' `
-Description 'Allow RDP' `
-Access Allow `
-Protocol Tcp `
-Direction Inbound `
-Priority 100 `
-SourceAddressPrefix * `
-SourcePortRange * `
-DestinationAddressPrefix * `
-DestinationPortRange 3389
$nsgname = "testvm01nsg"
$nsg = New-AzureRmNetworkSecurityGroup `
-ResourceGroupName $rgname `
-Location $vmlocation `
-Name $nsgname `
-SecurityRules $rdp
Set-AzureRmVirtualNetworkSubnetConfig `
-VirtualNetwork $vnet `
-Name $subnetname `
-AddressPrefix "192.168.1.0/24" `
-NetworkSecurityGroup $nsg
$pipname = "testvmpip"
$publicIp = New-AzureRmPublicIpAddress `
-ResourceGroupName $rgname `
-Name $pipname `
-location $vmlocation `
-AllocationMethod Dynamic
$nicname = "testvm01nic"
$nic = New-AzureRmNetworkInterface `
-ResourceGroupName $rgname `
-Name $nicname `
-Location $vmlocation `
-SubnetId $vnet.Subnets[0].Id `
-PublicIpAddressId $publicIp.Id `
-EnableAcceleratedNetworking
$cred = Get-Credential
$vmname = "testvm01"
$vmConfig = New-AzureRmVMConfig -VMName $vmname -VMSize "Standard_DS4_v2"
$vmConfig = Set-AzureRmVMOperatingSystem -VM $vmConfig `
-Windows `
-ComputerName $vmname `
-Credential $cred `
-ProvisionVMAgent `
-EnableAutoUpdate
$vmConfig = Set-AzureRmVMSourceImage -VM $vmConfig `
-PublisherName "MicrosoftWindowsServer" `
-Offer "WindowsServer" `
-Skus "2016-Datacenter" `
-Version "latest"
$vmConfig = Add-AzureRmVMNetworkInterface -VM $vmConfig -Id $nic.Id
New-AzureRmVM -VM $vmConfig -ResourceGroupName $rgname -Location $vmlocation
PowerShell を見て頂くと、わかると思いますが、NIC を作成するときに、「-EnableAcceleratedNetworking」をつけてますね。
Linux環境(CLI2.0)
VM が Linux 環境の場合は、CLI で構成するチュートリアルを見るのがいいと思います。
Create a Linux virtual machine with Accelerated Networking
こっちも、自分が試したスクリプトをざっくり貼っておきます。
ちなみに、CLI を動かした環境は、Windows 環境だったので改行が入ってるところは、「`」にしています。
az group create --name testsriovlingrp --location centralus
az network vnet create `
--resource-group testsriovlingrp `
--name testsriovlinvnet `
--address-prefix 192.168.0.0/16 `
--subnet-name testsriovlinsubnet `
--subnet-prefix 192.168.1.0/24
az network nsg create `
--resource-group testsriovlingrp `
--name testsriovlinnsg
az network nsg rule create `
--resource-group testsriovlingrp `
--nsg-name testsriovlinnsg `
--name Allow-SSH-Internet `
--access Allow `
--protocol Tcp `
--direction Inbound `
--priority 100 `
--source-address-prefix Internet `
--source-port-range "*" `
--destination-address-prefix "*" `
--destination-port-range 22
az network public-ip create `
--name testsriovlinpip `
--resource-group testsriovlingrp
az network nic create `
--resource-group testsriovlingrp `
--name testsriovlinnic `
--vnet-name testsriovlinvnet `
--subnet testsriovlinsubnet `
--accelerated-networking true `
--public-ip-address testsriovlinpip `
--network-security-group testsriovlinnsg
az vm create `
--resource-group testsriovlingrp `
--name testsriovlin01 `
--image UbuntuLTS `
--size Standard_DS4_v2 `
--admin-username azureuser `
--generate-ssh-keys `
--nics testsriovlinnic
Linux 環境でPeering を作ってネットワーク速度検証してみた
今回も iperf3 で試してみました。
iperf3 の使い方はこちらをご覧ください。
また、SR-IOV を使ってない場合の速度については、こちらをご覧ください。
[ 5] local 192.168.1.4 port 5201 connected to 192.169.1.4 port 54744 [ ID] Interval Transfer Bandwidth [ 5] 0.00-1.00 sec 1.53 GBytes 13.1 Gbits/sec [ 5] 1.00-2.00 sec 684 MBytes 5.74 Gbits/sec [ 5] 2.00-3.00 sec 682 MBytes 5.72 Gbits/sec [ 5] 3.00-4.00 sec 684 MBytes 5.74 Gbits/sec [ 5] 4.00-5.00 sec 683 MBytes 5.73 Gbits/sec [ 5] 5.00-6.00 sec 683 MBytes 5.73 Gbits/sec [ 5] 6.00-7.00 sec 680 MBytes 5.71 Gbits/sec [ 5] 7.00-8.00 sec 682 MBytes 5.72 Gbits/sec [ 5] 8.00-9.00 sec 684 MBytes 5.74 Gbits/sec [ 5] 9.00-10.00 sec 683 MBytes 5.73 Gbits/sec [ 5] 10.00-10.04 sec 25.9 MBytes 5.68 Gbits/sec - - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval Transfer Bandwidth Retr [ 5] 0.00-10.04 sec 7.56 GBytes 6.47 Gbits/sec 562 sender [ 5] 0.00-10.04 sec 7.56 GBytes 6.47 Gbits/sec receiver
たしかに、早い気がする。
この確かめ方でよかったんだっけ?とは思いますが、前に試したときは同一リージョンで Transfer が 1.5 GB程度だったので、明らかに値は大きい。
30GBには、程遠いけど
** 追記 **
再度、NIC に「–accelerated-networking true」を設定しないパターンで試してみました。
Connecting to host 192.170.1.4, port 5201 [ 4] local 192.171.1.4 port 39662 connected to 192.170.1.4 port 5201 [ ID] Interval Transfer Bandwidth Retr Cwnd [ 4] 0.00-1.00 sec 400 MBytes 3.36 Gbits/sec 5 2.24 MBytes [ 4] 1.00-2.00 sec 428 MBytes 3.59 Gbits/sec 0 2.42 MBytes [ 4] 2.00-3.00 sec 439 MBytes 3.68 Gbits/sec 0 2.57 MBytes [ 4] 3.00-4.00 sec 432 MBytes 3.63 Gbits/sec 0 2.68 MBytes [ 4] 4.00-5.00 sec 446 MBytes 3.74 Gbits/sec 0 2.78 MBytes [ 4] 5.00-6.00 sec 445 MBytes 3.73 Gbits/sec 17 2.03 MBytes [ 4] 6.00-7.00 sec 442 MBytes 3.71 Gbits/sec 0 2.17 MBytes [ 4] 7.00-8.00 sec 436 MBytes 3.66 Gbits/sec 0 2.30 MBytes [ 4] 8.00-9.00 sec 442 MBytes 3.71 Gbits/sec 0 2.42 MBytes [ 4] 9.00-10.00 sec 440 MBytes 3.69 Gbits/sec 0 2.54 MBytes - - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval Transfer Bandwidth Retr [ 4] 0.00-10.00 sec 4.25 GBytes 3.65 Gbits/sec 22 sender [ 4] 0.00-10.00 sec 4.25 GBytes 3.65 Gbits/sec receiver
なるほど、「–accelerated-networking true」の設定の有無で大体倍くらいの速度の違いがありますね。
なんとなく、SR-IOV が効いているっぽい。
まとめ
NW 周りは、Ignight で出てきた、Global Peering もあるし、今回の SR-IOV で、HWオフロードが行われるようになって、ますます柔軟な NW を構築できるようになってきていると思います。
今年は、IaaS も大きく変わっていくのかな。。


コメント