Tuning cache configuration parameters
For the most users, the default cache configuration works fine. But if you want to further fine-tune the cache configuration parameters, you can do that through VolumeAttributesClass . For more information, see VolumeAttributesClass.
For the Red Hat OpenShift platform, tuning parameters for caching is a technology preview feature, due to the VolumeAttributesClass support statement from Red Hat OpenShift. For more information, see Understanding feature gates.
Which cache parameters can be tuned
The cache configuration parameters, which can be tuned with a VolumeAttributesClass are afmNumFlushThreads
, afmPrefetchThreshold
, afmObjectFastReaddir
, afmFileOpenRefreshInterval
, and afmObjectSyncOpenFiles
.
You can find more details about these parameters in the IBM Storage Scale mmchfileset command.
Prerequisite for tuning cache configuration parameters
- Make sure that you are on Red Hat OpenShift 4.18 (or Kubernetes 1.31).
- Make sure that the feature gate for VolumeAttributesClass is enabled for your platform.
How to tune cache configuration parameters
You can tune the cache configuration parameters with the following steps:
- Create a VolumeAttributesClass with the necessary parameters and values. For example:
apiVersion: storage.k8s.io/v1beta1
kind: VolumeAttributesClass
metadata:
name: vac-cache1
driverName: spectrumscale.csi.ibm.com
parameters:
afmNumFlushThreads: "10"
afmPrefetchThreshold: "5"
- Use the VolumeAttributesClass name in the PersistentVolumeClaim (PVC) spec. You can add the VolumeAttributesClass name in a PVC spec before creating a PVC or you can choose to update the PVC spec after it is created and in bound state. For example:
apiVersion: v1
kind: PersistentVolumeClaim
spec:
...
volumeAttributesClassName: vac-cache1