SSD Read cache is configured once per each pstorage mount point. PStorage is a storage abstraction layer, therefore caching works in a way similar to HDD Cache - per-block. This means that any object stored on a pstorage can benefit from the Read Cache, regardless of virtualization technology, the only requirement for caching - data should be accessed often enough to get cached.
Caching mechanism works based on access statistics - if same block is read more than 3 times, it will get cached. In result most used data will eventually fill the cache significantly improving read operations.
NOTE: Placing Cache to a non-SSD disk won't bring any speed improvement - benefit comes from SSD drive I\O speed.
The only limitation to caching is - sequential read operations are not using cache. This design is implemented on purpose because caching sequential reads is too expensive in terms of workload and SSD drive utilization.
How to implement Caching
Parallels Cloud Storage Administrator's Guide pages 92-94 describe how to mount pstorage with the Cache functionality.
Note, there are special requirements for SSD disks - they should have technology allowing to maintain data integrity in case of a power failure. You may learn more about it in Parallels Cloud Storage Administrator's Guide page 90.
How to test and monitor Caching
To check whether the cache for a mounted cluster is active and view its current parameters, you can use this command:
# cat /pstorage/pcs1/.pstorage.info/read_cache_info path : /mnt/ssd/pstorage-cache-for-cluster-pcs1 main size (Mb) : 56000 boot size (Mb) : 8000 block size (Kb) : 64 checksum : enabled
Note: replace "pcs1" with your cluster name"
If the cache does not exist, the command output is empty. Otherwise, the command prints:
- path to the cache file
- size of the main and boot caches
- block size
- checksum status
You can monitor cache usage with the following command:
# pstorage mnt-top