Looking at the Write Cache in Storage Spaces Direct

If you’ve ever dealt with a SAN or Storage guy before, you’ll know that they usually have a huge passion for cache stats. This is because the secret sauce of accelerating cheap storage for years has been to stick a small amount of expensive but super fast flash in front of your slower spinning disk, or in recent years, your cheaper low endurance SSDs.
Because of this, it was always a good idea to keep an eye on how your cache was going, making sure things like Cache Hit Misses were low, and that your Write Cache wasn’t overallocated.
And Storage Spaces Direct (S2D) is no different today, especially in Hybrid (SSD+HDD) deployments.

Today, we’ll focus in on the Write Cache portion of S2D’s caching technology, as it’s easy to forget about and overlook.

Now if you’re running Windows Server 2019, the new Cluster Performance History makes this very easy for you.
If you want to see the total Cluster cache write usage:

Or if you want to see the per node usage:

This is all well and good if you’ve already made the mode to Windows Server 2019, but what if you’re still on Windows Server 2016?
Well the good news is that the counters still exist, however they’re not as easy to read as they are in Windows Server 2019.
To get the same information, we need to look at the following Performance Counters:

  • Cluster Storage Cache Stores
    • Cache Pages Bytes
    • Cache Pages Dirty

Cache Pages Bytes is pretty self explanatory, it’s the size of the cache. Cache Pages Dirty however looks like some alien number that doesn’t match up to anything, and that’s partly true, but only because we’re still missing a key piece of information, how big is a cache page?

Finding that is as simple as running (Get-ClusterS2D).CachePageSizeKBytes
With this, we can take our dirty counter value and times it by the cache page size to work out the write cache allocation.

Now that’s now the easiest thing to check when you’re in a hurry, or across multiple hosts and clusters, so I’ve created a small function to wrap it all up for you.

Hopefully this can help give some of you out until you can upgrade to Windows Server 2019!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.