Microsoft Azure - Disk Caching

We saw in the previous chapter ‘Disk Configuration’, how we had to choose cache preference for the disk we attached. By default it is ‘none’. We can choose read-only or read/write as per our requirements. This chapter will discuss how this setting affects the performance of input/output operations.

Disk caching

Normally, cache settings make considerable improvement when read-write operations with large amount of data are done. However, if lot of random I/O operations are done, turning the cache off is preferable as operations on cache incur charges on the basis of number of transactions. Random operations will not make any signification improvement in performance.

Read cache improves the performance, when data is read before, during input-output operations, and stored into cache. Also cache should be big enough to store all the data.

For all the OS disks, in-memory caching is done by default unless it is turned off manually by the user. If lots of random I/O operations on files are done in OS disks, it is better to move them in a data disk where by default cache is turned off. Cache settings can be manipulated using PowerShell command lets, APIs and Azure management portal. We can set the cache from the management portal while creating virtual machines and data disks.