Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference in the "Host Cache Preference" settings when adding a disk to an Azure VM?

When adding a VHD data disk to a VM I am asked for a "Host Cache Preference" (None, Read Only, Read/write).

Can someone tell me the effect of choosing one over the other?

Specifically, I am using a VM as a Build Server so the disks are used for compiling .Net source code. Which setting would be best in this scenario?

like image 929
Mark Avatar asked Oct 14 '13 23:10

Mark


People also ask

What is host caching in azure disk?

Host caching works by bringing storage closer to the VM that can be written or read to quickly. The amount of storage that is available to the VM for host caching is in the documentation. For example, you can see the Standard_D8s_v3 comes with 200 GiB of cache storage.

What is the default setting for caching on operating system disks?

The default setting for disk caching for OS disk is Read\write whereas the default setting for data disk is Read caching.

What can you use to identify underutilized or unused Azure virtual machines?

Azure Advisor monitors your virtual machine usage for seven days and then identifies underutilized virtual machines. Virtual machines whose CPU utilization is five percent or less and network usage is seven MB or less for four or more days are considered low-utilization virtual machines.


1 Answers

Just as the settings mention this setting turns on caching preferences for I/O. The effect of changing them is that reads, writes or both read/writes can be cached for performance. For example, if you have read-only database/Lucene index/read-only files it would be optimal to turn on read-cache for the drive.

I have not seen dramatic performance changes in changing this setting (until I used SQL Server/Lucene) on the drives. High I/O will be improved by stripping disks...in your case if you have millions of lines of code across 10,000s of files then you could see performance improvement in reading/writing. The default IOPs max for a single drive is 500 IOPs (which is about 2x15k SAS drives or a high-end SSD). If you need more than that, add more disks and stripe them...

For example, on an extra large VM you can attach 16 drives * 500 IOPs (~8,000 IOPs): http://msdn.microsoft.com/en-us/library/windowsazure/dn197896.aspx (there are some good write-ups/whitepapers for people who did this and netted optimal performance by adding the max amount of smaller drives..rather than just one massive one).

Short summary: leave the defaults for caching. Test with an I/O tools for specific performance. Single drive performance will not likely matter, if I/O is your bottleneck striping drives will be MUCH better than the caching setting on the VHD drive.

like image 137
Bart Czernicki Avatar answered Sep 22 '22 19:09

Bart Czernicki