Azure Blob Cache And Disk Performance

In this post I’m going to take a deep dive into Azure Blob cache and disk performance. In my previous post I touched on Azure disk performance and cache but after that post I had so many unanswered questions that I started researching and running my own tests to see what you kind of performance you get from Azure disks and how caching affects their performance. Everything you need to know about Azure disks are explained in these two posts around premium storage and standard storage but there is a lot to digest and I wanted to make a summary for my own education.

First what is Azure blob cache?
Premium Storage: On the DS series machines and I assume other VMs that also support premium storage you have Blob Cache. When you enable read-only cache your disk reads are serviced from the host server RAM or local SSD, if the requested read is not in the cache it will be retrieved from Azure Storage. If you enable read/write cache, writes are cached locally in the host RAM or local SSD until they are flushed to Azure Storage, unless write-through is explicitly requested by the application.

Standard Storage: On a VM that uses standard storage the local host HDD and RAM can be used for read cache and the host RAM for write caching. From my understanding these local disks are mechanical HDDs and Azure Blob Storage can provide better IOPS for heavy random reads than these local disks. I’ll show you some tests I performed later on since I wanted to know at which point is it better not to have caching enabled.

Temporary disks
Apart from your OS disk you will also see a temporary disk in your Azure VM. I always wondered why these disks have a warning that you shouldn’t store any data you will need later on since it can be lost. Turned out these disks are actually local disks on the VM host not Azure Blob Storage. For premium storage VMs these are SSD and for standard storage VMs mechanical HDD. If your VM is moved to a different VM host you loose this disk.

Performance throttling
On premium storage machines you will see a limit for the IOPS and throughput in MB/S for the VM as well as the disks (P10,P20,P30). You will be throttled whenever you reach either of them so make sure your VM can deliver all the IOPS for the number of disks you add to it. With standard storage the disk IOPS is 500 and the throughput 66 MB/S.

Cache limits
Premium Storage: The cache limits where clearly explained in the reference posts mentioned earlier, 4000 IOPS and 33MB/S per core but I wanted to see for myself. In my tests I used a DS4 machine with 8 disks striped into one virtual disk using Storage Spaces with an IOPS limit of 25600 IOPS and throughput limit of 256MB per second. I ran a 4KB, random write test with 100 QD  (queue depth) with write cache on and reached 32000 IOPS which is bang on the money 8 cores * 4000 IOPS and 264MBs = 8 cores * 33MB/S. With the disk set to read-only cache I could only reach 25600 IOPS when I ran the same write test, which is the VM limit and throughput of 256MB per second.

Standard Storage: At the end of the post about standard storage they mention that Azure Blob storage can handle heavy random IO better then the local disk so I ran a few tests to see at which point it is better to switch off cache. I tried random and sequential reads and writes with different queue lengths and data sizes but cache was faster. The cache performance did degrade over time but it wasn’t much slower than the local disk and I ran it for 90 minutes. May be if the VM host is under memory pressure or heavy I/O load on it’s local disks you will reach this point sooner but for short bursts off I/O, caching is faster.

Queue Depth and latency
Since there is quite a bit of latency involved when your I/O request is not serviced from local cache and it has to go all the way to Azure Blob Storage I had to up my queue depth to reach the performance limits of the VM and caching in Premium Storage. Large numbers of small random access disk operations will suffer more than a small number of large sequential access disk operations. Keep this in mind if you are designing applications that are disk I/O intensive, you will only reach maximum performance if you can utilise the local cache or have multiple I/O requests queued up.

Francois Delport

Azure Disk And SQL Configuration Options In Azure Portal

In this post I’m going to take a closer look at Azure Disk and SQL configuration options in Azure Portal. Microsoft recently added some more configuration options for creating SQL virtual machines using the Azure Resource Manager (ARM) deployment model in the preview portal.

When you create a SQL VM you can specify connectivity options, SQL authentication, automatic patching, automatic backups, key vault integration and storage optimisation. Note this is only for SQL 2014 using ARM and Premium Storage for storage optimisation.

In this post I’m going to focus on the storage optimisation settings, the others are pretty much self explanatory and you can read more about all of the settings here.

Disk Performance
First a detour to talk about VM storage performance, independent of SQL. The type of VM you choose determines how many disks you can connect to a VM, the max IOPS on a disk or VM and whether you can use Premium Storage. You can read the details here but in short size A, D, Dv2, G is limited to 500 IOPS per disk, the number of disks you can have varies greatly from 1 to 64. DS and GS can use Premium Storage with 50 000 and 80 000 max IOPS per VM, the number of disks also varies greatly from 2 to 64. The throughput and IOPS per disk depends on the size of the Premium Storage disk you select, 128GB is 500 IOPS 100MB/s, 512GB is 2300 IOPS 150 MB/s and 1025GB is 5000 IOPS 200MB/s. Azure rounds the size of your disk up to the closest premium disk size, you can read the details here.

SQL Server Specified IOPS
If a single disk doesn’t provide the IOPS you require you can stripe multiple disks together using Storage Spaces to increase performance. This happens automatically when you specify the required IOPS when you create your SQL server VM. In the examples below the max IOPS is limited by the type of VM chosen DS2 or DS14.

Azure Disk And SQL Configuration Options In Azure Portal

Based on the required 51200 IOPS we selected you will see 11 disks added to the DS14 machine in the Storage Manager.

Azure Disk And SQL Configuration Options In Azure Portal

If you run:

Get-VirtualDisk | format-list

from a PowerShell command prompt you will see the virtual disk has 11 columns, meaning data written to the disk will be striped into 11 blocks, each block written to a single underlying disk.

If for some reason you can’t use Premium Storage you can do the same with Standard Storage data disks but you have to do it yourself after the VM is created. When you create the virtual disk make sure the number of columns match the number of disks for maximum performance.

When adding multiple disks to a VM keep in mind the IOPS limit on each disk and also the VM IOPS limit that overrides the disk IOPS limit.

Disk Caching
When you create a disk in Azure you can choose what type of caching you want for the disk.

Azure Disk And SQL Configuration Options In Azure Portal
The data disks (not the OS disk) added to the SQL VM are all set to use read-only cache by default, this might seem counter intuitive to using read/write cache but there is a good reason. SQL uses write-through writes which bypasses cache anyway and goes directly to Azure Storage instead of local cache. Secondly there is no artificial limit imposed on read-only cache thus you can get very good read performance with read-only cache but write cache is limited to 4000 IOPS.

Francois Delport

Azure Active Directory And Azure Accounts

In post I’m going to take a closer look at Azure Active Directory and Azure Accounts. Granting other accounts access to Azure subscriptions and controlling the permissions they have is not a great experience at the moment. When you add someone to your Azure subscription they have co-admin access, which doesn’t help much if you want to prevent accidents.

Luckily we now have Azure Role Based Access Control to grant fine grained access to users. I started looking into RBAC and saw you need Azure Active Directory since the users are you assigning to roles must come from a directory and Azure Resource Manager since you will be assigning role permissions at resource level. There are tons of very detailed information about Azure AD but not in one place for a quick overview so I am writing this one.

If you look at Azure AD you will see there are different versions and I was wondering which one you need for which scenarios. You can get a very good and detailed comparison of the different versions here. I’m going to give a quick explanation for those who like it short and sweet.

All editions: You get sync with on-prem AD using Azure AD Connect, SSO for SAAS web and custom apps, user management, self-service password change (not reset) and some basic reports.

Azure AD Free: This is the edition we all get by default when you sign up for Azure or Office 365, you are limited to 10 SSO applications per user and you only have the most basic reports, the number of AD objects is limited to 500K.

Azure AD Basic: You get more reports, self-service password reset, company branding, SSO for on-prem applications using Application Proxy, 99.99% SLA

Azure AD Premium: Enterprise features, more reports, password unlock and reset with on-prem write back, Multi-factor Authentication for on-prem and cloud via phone call, text message, smart app with optional verification code, Cloud App Discovery, Microsoft Identity Manager licenses.

Some extra bits around Azure AD
Azure AD Connect makes it easier to manage users so you don’t have to create the same users on-prem and in Azure, it syncs the users in Azure AD with your on-prem AD.

Looks to me like you can’t use Azure AD instead of your local AD, it is not Active Directory as a service for on-prem. At the moment you can only add Windows 10 devices to Azure AD. Please let me know in the comments if I’m wrong.

When Azure started you could only login with Microsoft Live accounts, with Azure AD you can login to Azure using your Azure AD account which saves the hassle of managing Microsoft accounts for everyone. That said, if you only have a few people accessing Azure you can manually create users in your Azure Directory from existing Microsoft Live accounts or from scratch as Azure AD users or from other Azure Directories or external users for instance granting consultants access.

Your default Azure Directory will have the onmicrosoft.com domain name, if you want to use your own one you can add a custom domain like mycompany.com, this way you can create Azure AD users using your existing email addresses for example [email protected].

You can have both a Microsoft Live and Azure AD account with the same username but you will have to choose which one you are singing into when you login to the portal.

AzureLogin

Each Azure subscription trusts one Azure Directory and you can change the default one. Many subscriptions can trust the same Azure Active Directory, a subscription can expire but the directory will still remain there.

Francois Delport