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/) で行った。
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)
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)
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)
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)
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
http://msdn.microsoft.com/library/azure/dn248436.aspx
マイクロソフトの調査でも 2008 R2 のストライプ・ボリューム構成では性能に問題があることが確認されているようだ。
Windows Azure 仮想マシンのディスク ストライプ オプション (29ページ)
マイクロソフトが実施したテストでは、Windows Azure 仮想マシンで最適なパフォーマンスを得るには、オペレーティング システム ネイティブのストライプが推奨されないことがわかりました。テストでは、ストライプ ボリューム構成と Windows Azure 仮想マシンの単一ディスク構成を比較しましたが、ストライプ ボリューム構成ではデータベース ファイルの IOPS とスループットに深刻な影響 が発生し、最適なパフォーマンスが得られませんでした。
また、Windows Server 2012 で公開された記憶域プールのテクノロジもテストしました。 この場合は、優れたパフォーマンス特性が組み込まれるだけでなく、ニーズに合わせてディスク容量を追加または削減できます。
ストライピングなしの単一ディスクでも、Azureのストレージはディスク3台のミラーリングだからか、SQLを並列実行すれば3重までは応答時間がほとんど変わらずにスループットが上がるようだ。