•Cache settings can 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.
•Can be configured using portal and powershell
ReadOnly
By configuring ReadOnly
caching on Premium Storage data disks, you can achieve low Read latency and get
very high Read IOPS and Throughput for your application. This is due two
reasons,
Reads performed from cache, which is on
the VM memory and local SSD, are much faster than reads from the data disk,
which is on the Azure blob storage.
Premium Storage does not count the Reads
served from cache, towards the disk IOPS and Throughput. Therefore, your
application is able to achieve higher total IOPS and Throughput.
ReadWrite
By default, the OS disks have ReadWrite caching enabled. We have recently added support for ReadWrite caching on data disks as well. If you are using ReadWrite caching, you must have a proper way to write the data from cache to persistent disks. For example, SQL Server handles writing cached data to the persistent storage disks on its own. Using ReadWrite cache with an application that does not handle persisting the required data can lead to data loss, if the VM crashes.
By default, the OS disks have ReadWrite caching enabled. We have recently added support for ReadWrite caching on data disks as well. If you are using ReadWrite caching, you must have a proper way to write the data from cache to persistent disks. For example, SQL Server handles writing cached data to the persistent storage disks on its own. Using ReadWrite cache with an application that does not handle persisting the required data can lead to data loss, if the VM crashes.
As an example, you can apply these
guidelines to SQL Server running on Premium Storage by doing the following,
Configure “ReadOnly” cache on premium storage disks hosting
data files.
a. The fast reads from cache lower the SQL Server query time since data pages are retrieved much faster from the cache compared to directly from the data disks.
b. Serving reads from cache, means there is additional Throughput available from premium data disks. SQL Server can use this additional Throughput towards retrieving more data pages and other operations like backup/restore, batch loads, and index rebuilds.
a. The fast reads from cache lower the SQL Server query time since data pages are retrieved much faster from the cache compared to directly from the data disks.
b. Serving reads from cache, means there is additional Throughput available from premium data disks. SQL Server can use this additional Throughput towards retrieving more data pages and other operations like backup/restore, batch loads, and index rebuilds.
Configure “None” cache on premium storage
disks hosting the log files.
a. Log files have primarily write-heavy operations. Therefore, they do not benefit from the ReadOnly cache.
a. Log files have primarily write-heavy operations. Therefore, they do not benefit from the ReadOnly cache.
source : https://docs.microsoft.com/en-us/azure/storage/storage-premium-storage-performance#disk-caching/
Disk Type
|
Default Cache Setting
|
OS disk
|
ReadWrite
|
Data disk
|
None
|
Following are the recommended disk cache
settings for data disks,
Disk Caching Setting
|
Recommendation on when to use this setting
|
None
|
Configure
host-cache as None for write-only and write-heavy disks.
|
ReadOnly
|
Configure
host-cache as ReadOnly
for read-only and read-write disks.
|
ReadWrite
|
Configure
host-cache as ReadWrite
only if your application properly handles
writing cached data to persistent disks when needed. |
Good explanation with example, very useful...
ReplyDeleteAzure Online Training