Foreword
In the last article we discussed a repeatable testing methodology to quantify storage performance in the cloud, and in this article we'll put that methodology into practice. I've done substantial testing in Azure and aim to illustrate what your options are for scaling performance at this point in time.
Scope
I undertook this project to see what can be done to increase disk I/O in Windows Azure IaaS. Upon researching the topic I found several interesting articles. Among those are:- Timothy
Khouri: Windows Azure IaaS Performance – SQL and IOps (Link removed, site was exploited)
- Timothy
Khouri: Configuring Disks in Azure for More Performance (Link removed, site was exploited)
- MSDN: Performance Guidance for SQL Server in Windows Azure Virtual Machines
- MSDN: Getting Started with SQL Server in Windows Azure Virtual Machines
- Azure: Storage Pricing Details
- Azure: VM Pricing Details
- Virtual Machine and Cloud Service Sizes for Windows Azure
- Azure
Blogs: Windows Azure’s Flat Network Storage and 2012 Scalability
Targets
- Disk Striping (Software RAID 0) may or may not increase performance based on your workload.
- Striping will increase I/O capacity to a degree (which we'll test here).
- What software striping solution works better: legacy (Windows software RAID from 2000 to present) or Storage Spaces (new software "RAID" in Windows 2012 and up)?
- How does NTFS cluster size impact performance?
- If striping, disable geo-replication as Microsoft explicitly warns against the use of geo-replication with this solution.
- If possible, use native application load distribution rather that disk striping to split I/O. (For example, split DB files in SQL across disks)
- Some articles reference needing to use multiple storage accounts to get maximum performance. This is not true; as of 6/7/2012 storage account targets are 20,000 IOPS per account. Unless you will exceed the 20,000 keep all your disks on one account for the sake of simplicity. We will prove that does not have an impact on performance.
Putting it All Together
We'll use the testing methodology outlined in part 1 of this article to collect the results. In this case we need to first add disks and set up stripes in Azure Windows VMs.Note: To jump straight to Azure disk performance tests, scroll to the bottom of this article.
Create New Disks and Attach to Designated VM
In order to run all the tests listed below, you need to know how to create new disks and attach them to your virtual machine. My favorite solution to this is to use a locally created dynamic VHD and upload it to the location you would like using PowerShell. Let's go through the process of attaching one disk as a primer:- Decide which storage account you will use for these disks. If you plan on doing striping of any kind, ensure the storage account is set to "Locally Redundant" replication (Storage->Desired Storage Account->Configure), as "Geo Redundant" is not supported. Since the replication setting applies to all blobs (Azure's terminology; disks) in that account you may want to have a dedicated account for these disks to keep your others Geo Redundant.
- Determine what container you would like to store your Azure disk blob by opening the Azure management portal and navigating to Storage->Desired Storage Account->Containers and copy the URL to your clipboard. To keep things simple you may want to create a new storage container, so do so now and use that URL if desired.
- Using Hyper-V (On Windows 2008 or higher including Windows 8) create an empty dynamically expanding VHD disk of your desired size. For my testing I have been using 10GB disks. Note 1: Do not create a VHDX; Azure uses the older VHD format. Note 2: You'll need to re-create the VHD for each disk if you intend on using Storage Spaces as each disk must have a unique ID.
- This disk will be uploaded to the container we selected in step 1. Determine the name you want the disk to be referenced by in Azure and execute the following script:
- Add this new disk as available to VMs by navigating to Virtual Machines->Disks->Create
- Enter the desired management name for this disk and input or browse to the URL of the VHD you just uploaded and click the check box.
- Attach the disk to your VM by navigating to Virtual Machines->Ensure your desired VM is highlighted->Attach->Attach Disk
- Select the disk we just added. Your cache preference will depend on the application. In my case this is off but you will want to use the methodology outlined in the first part of this article to test caching impact for your application. Note a change of cache status requires a VM reboot.
#create a dynamically expanding 10GB VHD; change size as appropriate
New-VHD –Path $sourceVHD –SizeBytes 10GB -Dynamic
#import Azure cmdlets
import-module azure.psd1
#specify your subscription so PS knows what account to upload the data to
select-azuresubscription "mysubscriptionname"
#$sourceVHD should be the location of your empty vhd file
$sourceVHD = "D:\Skydrive\Projects\Azure\AzureEmpty10G_Disk.vhd"
#$destinationVHD should be the URL of the container and the name of the vhd you want created in your account. Obviously for subsequent disks you need to change the VHD name.
$destinationVHD = "http://yourstorageacctname.blob.core.windows.net/vhds/data02.vhd"
#now upload it.
Add-AzureVhd -LocalFilePath $sourceVHD -Destination $destinationVHD
Set Up a Traditional Software Stripe in Windows
Setting up a traditional software stripe is easy. I've tested this on Windows 2003 and higher.- Logon to your VM as an admin and open the Disk Management tool.
- If prompted, allow the initialization of the disks.
- Right-click on one of the newly created empty volumes and select New Striped Volume.
- Select the desired disks and continue.
- Create and format a new NTFS disk using your striped volume. Make sure to pay attention to the cluster size (results below).
Setup a Storage Spaces Software Stripe in Windows 2012 or Higher
Microsoft introduced a new approach to disk pooling in Windows Server
2012 and Windows 8 called Storage
Spaces. This interesting new tech allows for a myriad of different
configuration options including disk tiering which can be useful for
on-premise servers. In this case we'll be using the "simple" pool type
which is similar to disk striping. - Open Server Manager and navigate to File and Storage Services -> Volumes -> Storage Pools
- Under Storage Pools you should see "Primordial". (As opposed to "Unused Disks". I'm guessing someone was pretty proud of that.) Right click it and select "New Storage Pool".
- Walk through the Wizard selecting each disk you would like to be part of the pool.
- On the results page, ensure "Create a virtual disk when this wizard closes" is selected and click "Close".
- Walk through the Virtual Disk Wizard, specifying a meaningful name and selecting simple storage layout and fixed provisioning.
- On the results page, ensure "Create a volume when this wizard closes" is selected and click "Close".
- Complete the New Volume Wizard specifying your desired drive letter and desired NTFS cluster size.
Run Tests/Collect Results!
Now that we have our disks configured, we need to run our tests. For instructions how how to do so, see part 1 of this topic here.When analyzing the IOMeter output you will want to pay special attention to the following metrics:
- IOPS (Cumlative, Read, Write, Higher is better)
- MBps (Cumlative, Read, Write, Higher is better)
- Response Time (Avg, Avg Read, Avg Write, lower is better)
Results
Now for the most important part, the findings. Tests performed:Sector Size Tests:
- 1 Disk, 4k Sector Size (default)
- 1 Disk, 8k Sector Size
- 1 Disk, 16k Sector Size
- 1 Disk, 32k Sector Size
- 1 Disk, 64k Sector Size
- 3 Disks, 4k Sector Size (results confirmation test)
- 3 Disks, 32k Sector Size (results confirmation test)
Table 1-Cluster Size Tests |
Table 2-Cluster Size Verification |
Legacy Disk Striping Tests:
- 1 Disk, 32k Sector Size
- 2 Disks, Striped Volume, 32k Sector Size
- 2 Disks in 2 Storage Accounts, Striped Volume, 32k Sector Size (Multiple Storage Account Test)
- 3 Disks, Striped Volume, 32k Sector Size
- 4 Disks, Striped Volume, 32k Sector Size
Table 3-Legacy Striping and Storage Account Tests |
Additionally, we also see that splitting disks across storage accounts makes no appreciable difference. Note: Bar charts for this results section have been combined into the graphs below.
Disk Striping Methodology Tests:
- 2 Disks, Striped Volume 32k Sector Size
- 2 Disks, Storage Spaces Simple, 32k Sector Size
- 3 Disks, Striped Volume, 32k Sector Size
- 3 Disks, Storage Spaces Simple, 32k Sector Size
- 4 Disks, Striped Volume, 32k Sector Size
- 4 Disks, Storage Spaces Simple, 32k Sector Size
Table 4-Legacy Striping vs. Storage Spaces Test |
Conclusion
I hope you have found these results interesting; I certainly have. Even if you choose not to run these tests yourself I hope my results prove helpful when sizing your machines. Since the access pattern I used is relatively universal it should be applicable in most scenarios.Software level disk striping works relatively well in Microsoft Azure to increase per-disk performance in lieu of a provider level solution similar to Amazon EBS provisioned IOPS. Splitting the workload across logical disks or VMs is preferred but not applicable to all workloads. When employing this solution make sure you select only locally redundant replication because Micrsoft warns that geo-redundant replication may cause data consistency issues on the replication target.
For additional information see the links near the top of this article. Thanks for reading!