Skip to content

Instantly share code, notes, and snippets.

@froop
Last active August 29, 2015 14:06
Show Gist options
  • Save froop/25a2b8d3e1f380ba4c65 to your computer and use it in GitHub Desktop.
Save froop/25a2b8d3e1f380ba4c65 to your computer and use it in GitHub Desktop.
Microsoft Azure 上の Windows Server におけるディスク・ストライピングの性能調査

Microsoft Azure 上の Windows Server 2008 R2 仮想マシンに Oracle データベースを移行してみたところ、 ディスクへのIOが遅いために処理時間が移行前の2倍くらいかかった。

そこで、ディスクを追加して Windows OS の機能でストライピング (RAID 0) してみたのだが効果がなかった。 どうも、データベースはランダムアクセスが主のため向いていないようだ。

ベンチマーク結果

ディスク2台のストライピングでベンチマークを取ってみたところ、Random Read の性能が良くない。 2012 R2 に変えてみたら少し速くなったが、それでも30%程度で期待していた2倍には程遠い。 計測は CrystalDiskMark 3.0.3 (http://crystalmark.info/) で行った。

Windows Server 2008 R2 単一ディスク構成

           Sequential Read :    33.412 MB/s
          Sequential Write :    18.088 MB/s
         Random Read 512KB :    21.263 MB/s
        Random Write 512KB :    17.922 MB/s
    Random Read 4KB (QD=1) :     0.357 MB/s [    87.1 IOPS]
   Random Write 4KB (QD=1) :     0.921 MB/s [   224.8 IOPS]
   Random Read 4KB (QD=32) :     2.073 MB/s [   506.1 IOPS]
  Random Write 4KB (QD=32) :     2.069 MB/s [   505.0 IOPS]

  Test : 1000 MB [E: 0.6% (0.1/16.0 GB)] (x5)
  Date : 2014/09/04 5:09:24
    OS : Windows Server 2008 R2 Datacenter (Full installation) SP1 [6.1 Build 7601] (x64)

Windows Server 2008 R2 ストライプ・ボリューム構成

           Sequential Read :    58.319 MB/s
          Sequential Write :    51.255 MB/s
         Random Read 512KB :    22.685 MB/s
        Random Write 512KB :    39.693 MB/s
    Random Read 4KB (QD=1) :     0.423 MB/s [   103.2 IOPS]
   Random Write 4KB (QD=1) :     0.870 MB/s [   212.4 IOPS]
   Random Read 4KB (QD=32) :     4.133 MB/s [  1009.1 IOPS]
  Random Write 4KB (QD=32) :     4.158 MB/s [  1015.1 IOPS]

  Test : 1000 MB [E: 0.6% (0.1/16.0 GB)] (x5)
  Date : 2014/09/04 4:01:24
    OS : Windows Server 2008 R2 Datacenter (Full installation) SP1 [6.1 Build 7601] (x64)

Windows Server 2012 R2 単一ディスク構成

           Sequential Read :    34.771 MB/s
          Sequential Write :    17.647 MB/s
         Random Read 512KB :    19.511 MB/s
        Random Write 512KB :    15.545 MB/s
    Random Read 4KB (QD=1) :     0.314 MB/s [    76.8 IOPS]
   Random Write 4KB (QD=1) :     0.814 MB/s [   198.7 IOPS]
   Random Read 4KB (QD=32) :     2.067 MB/s [   504.7 IOPS]
  Random Write 4KB (QD=32) :     2.071 MB/s [   505.7 IOPS]

  Test : 1000 MB [E: 0.4% (0.1/15.9 GB)] (x5)
  Date : 2014/09/04 5:01:07
    OS : Windows Server 2012 R2 Datacenter (Full installation) [6.3 Build 9600] (x64)

Windows Server 2012 R2 記憶域プール・ストライプ構成

           Sequential Read :    57.907 MB/s
          Sequential Write :    54.722 MB/s
         Random Read 512KB :    25.827 MB/s
        Random Write 512KB :    39.513 MB/s
    Random Read 4KB (QD=1) :     0.478 MB/s [   116.8 IOPS]
   Random Write 4KB (QD=1) :     0.886 MB/s [   216.2 IOPS]
   Random Read 4KB (QD=32) :     4.297 MB/s [  1049.0 IOPS]
  Random Write 4KB (QD=32) :     4.140 MB/s [  1010.7 IOPS]

  Test : 1000 MB [E: 0.3% (0.1/29.9 GB)] (x5)
  Date : 2014/09/04 13:17:00
    OS : Windows Server 2012 R2 Datacenter (Full installation) [6.3 Build 9600] (x64)

Windows Server 2012 R2 で記憶域プールを作成した PowerShell コマンド

New-StoragePool -FriendlyName StoragePool1 -StorageSubsystemFriendlyName "Storage Spaces*" -PhysicalDisks (Get-PhysicalDisk -CanPool $True)
New-VirtualDisk -StoragePoolFriendlyName StoragePool1 -FriendlyName VirtualDisk1 -ResiliencySettingName Simple -UseMaximumSize -Interleave 64KB
Get-VirtualDisk -FriendlyName VirtualDisk1 | Get-Disk | Initialize-Disk -Passthru | New-Partition -AssignDriveLetter -UseMaximumSize | Format-Volume

参考文献

Azure 仮想マシンにおける SQL Server のパフォーマンス ガイダンス

http://msdn.microsoft.com/library/azure/dn248436.aspx

マイクロソフトの調査でも 2008 R2 のストライプ・ボリューム構成では性能に問題があることが確認されているようだ。

Windows Azure 仮想マシンのディスク ストライプ オプション (29ページ)

マイクロソフトが実施したテストでは、Windows Azure 仮想マシンで最適なパフォーマンスを得るには、オペレーティング システム ネイティブのストライプが推奨されないことがわかりました。テストでは、ストライプ ボリューム構成と Windows Azure 仮想マシンの単一ディスク構成を比較しましたが、ストライプ ボリューム構成ではデータベース ファイルの IOPS とスループットに深刻な影響 が発生し、最適なパフォーマンスが得られませんでした。

また、Windows Server 2012 で公開された記憶域プールのテクノロジもテストしました。 この場合は、優れたパフォーマンス特性が組み込まれるだけでなく、ニーズに合わせてディスク容量を追加または削減できます。

@froop
Copy link
Author

froop commented Sep 13, 2014

ストライピングなしの単一ディスクでも、Azureのストレージはディスク3台のミラーリングだからか、SQLを並列実行すれば3重までは応答時間がほとんど変わらずにスループットが上がるようだ。

多重  SQL1        SQL2        SQL3        SQL4        SQL5        SQL6    応答平均    スループット/分
1   00:14.34    00:13.07    00:13.28    00:13.30    00:13.28    00:12.89    00:13.36    4.5
2   00:14.34    00:13.95    00:14.24    00:14.26    00:13.26    00:13.43    00:13.91    8.6
3   00:15.48    00:16.12    00:15.14    00:15.71    00:14.76    00:14.31    00:15.25    11.8
4   00:17.28    00:17.62    00:18.09    00:17.66    00:17.89    00:17.45    00:17.67    13.6
5   00:19.60    00:19.96    00:19.59    00:19.10    00:19.21    00:20.75    00:19.70    15.2
6   00:22.93    00:23.21    00:23.00    00:22.18    00:21.68    00:22.07    00:22.51    16.0
9   00:30.84    00:29.67    00:30.56    00:30.14    00:29.62    00:29.40    00:30.04    18.0
12  00:43.86    00:42.28    00:42.05    00:42.55    00:41.00    00:40.17    00:41.99    17.1

@froop
Copy link
Author

froop commented Sep 15, 2014

Windows Server 2012 R2 でのストライピングで、Oracle の 表フルスキャンする SELECT 文を速くしようといろいろ試したところ、New-VirtualDisk -Interleave 512KB が一番早かった。といっても3割程度の向上だけど。
逆に、64KBにしたら3倍くらい時間かかった。

@froop
Copy link
Author

froop commented Sep 16, 2014

AWSで上と同じ環境を作り、同じSQLを実行したところ、応答時間はほぼ同じだった。
ただ、並列で2重実行したら2倍遅くなったので、並列性能ではAzureの方が速い。
ストライピングなし (単一ディスク) の場合。
SSDと磁気ディスクの両方をやってみたがあまり違わなかった。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment