Overview
Cluster Shared Volumes (CSV) has many new features in Windows Server 2012 that will deliver the most resilient and highest performance storage infrastructure for your private cloud. One of those new features is the CSV Cache.
CSV Cache is a feature that allows you to allocate system memory (RAM) as a write-through cache. The CSV Cache provides caching of read-only unbuffered I/O. This can improve performance for applications such as Hyper-V, which conducts unbuffered I/O when accessing a VHD file. Unbuffered I/O’s are operations which are not cached by the Windows Cache Manager. What CSV Block Cache delivers is caching which can boost the performance of read requests, with write-through for no caching of write requests.
CSV Cache delivers caching at the block level, which enables it to perform caching of pieces of data being accessed within the VHD file. This is fundamentally very similar in the value it provides to other solutions on the market you may already be familiar with. The primary difference is that CSV Block Cache reserves its cache from system memory, where most solutions on the market today deliver cache in the form of SSD’s on a PCI card that you add to the server.
CSV Cache is completely integrated into the Failover Clustering feature and handles orchestration across the sets of nodes in the cluster.
Deployment Considerations
CSV Cache will deliver the most value in scenarios where VMs are used primarily for read requests, and are less write intensive. Scenarios such as Pooled VDI VMs or also for reducing VM boot storms. Because the applicability of CSV Cache depends on the workload and your specific deployment considerations, it is disabled by default.
You can allocate up to 20% of the total physical RAM for CSV write-through cache, which will be consumed from non-paged pool memory. Our preliminary testing has found 512 MB to deliver excellent gain at minimal cost, and is the recommend default value if enabled. Then based on your specific deployment and the I/O characteristics of the workloads in the VMs you may wish to increase the amount of memory allocated.
There are two configuration settings that allow you to control CSV Cache.
- CsvEnableBlockCache – This is a private property of the cluster Physical Disk resource. It allows you to enable CSV Cache on an individual disk. This gives you the flexibility to configure cache for read intensive VMs running on some disks, while allowing you to disable and prevent random I/O on other disks from purging the cache. For example parent VHD’s with high reads you would enable caching on Disk1, and high writes for differencing disks the CSV cache could be disabled on Disk2. The default setting is 0 for disabled, setting to a value of 1 enables CSV Block Cache on that disk.
- SharedVolumeBlockCacheSizeInMB – This is a cluster common property that allows you to define how much memory (in megabytes) you wish to reserve for the CSV Cache on each node in the cluster. If a value of 512 is defined, then 512 MB of system memory will be reserved on each node in the Failover Cluster. Configuring a value of 0 disables CSV Block Cache.
How to Configure CSV Cache
1. Open an elevated Windows PowerShell prompt
2. Define the size of the size of the cache to be reserved
(Get-Cluster). SharedVolumeBlockCacheSizeInMB = 512
3. Enable CSV Cache on an individual disk
Get-ClusterSharedVolume “Cluster Disk 1” | Set-ClusterParameter CsvEnableBlockCache 1
Considerations: The cache size can be modified with no downtime, however for the Hyper-V root memory reserve in the parent partition to be modified to accommodate the memory allocated to the CSV cache it does require a server reboot. To ensure resource contention is avoided, it is recommended to reboot each node in the cluster after modifying the memory allocated to the CSV cache.
Enabling CSV Cache on an individual disk requires that the Physical Disk resource be recycled (taken Offline / Online) for it to take effect.
Optimizing CSV Cache
The CSV Cache also provides a set of counters you can use to monitor the performance of the cache. You can leverage the Performance Monitor tool (PerfMon.msc) to add the following counts to monitor different aspects of the CSV Cache.
Open Performance Monitor, and under Add Counters you will find “Cluster CSV Volume Cache” with the following counters.
I/O satisfied from cache:
- Cache IO Read-Bytes
- Cache IO Read-Bytes/Sec
- Cache Read
- Cache Read/Sec
I/O satisfied from disk:
- Disk IO Read-Bytes
- Disk IO Read-Bytes/Sec
- Disk Read
- Disk Read/Sec
Total I/O:
- IO Read-Bytes
- IO Read-Bytes/Sec
- IO Read
- IO Read/Sec
Thanks!
Elden Christensen
Principal Program Manager Lead
Clustering & High-Availability
Microsoft