Set the cluster-wide CSV read cache limit by changing BlockCacheSize, which is measured in MiB per server.
Use an elevated PowerShell session:
# View current CSV cache allocation per server
(Get-Cluster).BlockCacheSize
# Example: cap the CSV cache at 512 MiB per server
(Get-Cluster).BlockCacheSize = 512
If a larger cache is currently configured, lower it to a value that leaves enough RAM for the host and VMs. For example:
-
512= 512 MiB per server -
1024= 1 GiB per server -
2048= 2 GiB per server
Important points:
- The CSV in-memory read cache is for read-only, unbuffered I/O. It does not cache writes.
- It is most useful for read-intensive workloads such as Hyper-V and VDI.
- If the workload is extremely write-intensive, the cache can add overhead and should be disabled.
- Up to 80% of total physical memory can be allocated to the CSV in-memory read cache in supported versions, so the cache should be capped carefully to avoid starving VMs and the host.
To make the new setting take effect immediately on newer versions, pause and resume the CSV volumes, or move them between nodes:
Get-ClusterSharedVolume | ForEach {
$Owner = $_.OwnerNode
$_ | Move-ClusterSharedVolume
$_ | Move-ClusterSharedVolume -Node $Owner
}
If the environment is Windows Server 2012 R2 or later, another documented example is:
(Get-Cluster).BlockCacheSize = 512
If the workload pattern is not benefiting from cache locality, reducing the value further or disabling the cache is appropriate. In Windows Server 2016, the default is 0 (disabled). In Azure Local and Windows Server 2019, the default is 1024 (1 GiB).