Specify rsize and wsize mount parameters for SC and static PV of NFS storage
Problem Description
- Due to NFS's automatic negotiation of block size, the read and write block sizes of NFS will tend to increase (NFS storage memory/4G) * 1024K, with a maximum of 1M.
- If users are in a business scenario involving frequent small block writes, they can achieve high performance for such writes by modifying the mount parameters rsize and wsize. However, the current interface does not provide customization of mount parameters, and users need to create them manually via a YAML file.
Alert Information
None
Effective Troubleshooting Steps
None
Root Cause
None
Solution
-
The maximum values for rsize and wsize are 1048576 (1M). Users can adjust these values based on the size of the files they are writing. Below are the configurations for SC and PV.
-
SC YAML example
apiVersion: storage.k8s.io/v1 kind: StorageClass metadata: annotations: ske-com/alias: "" name: rwsize-sc mountOptions: - rsize=4096 - wsize=4096 parameters: csi.ske.com/type: std-nfs nfs.csi.ske.com/server: 10.131.xxx.143 nfs.csi.ske.com/share: /home/data provisioner: nfs.csi.ske.com reclaimPolicy: Delete volumeBindingMode: WaitForFirstConsumer -
PV YAML example
apiVersion: v1 kind: PersistentVolume metadata: name: rwsize-static-pv spec: capacity: storage: 10Gi accessModes: - ReadWriteMany persistentVolumeReclaimPolicy: Delete mountOptions: - rsize=4096 - wsize=4096 csi: driver: nfs.csi.ske.com volumeHandle: nfs-server.default.svc.cluster.local/share## volumeAttributes: csi.ske.com/type: std-nfs nfs.csi.ske.com/server: 10.131.xxx.143 nfs.csi.ske.com/share: /home/data nfs.csi.ske.com/subdir: "123"
Impact Scope
- Affects the NFS storage write rate and write frequency. Typically, large blocks are suitable for large file writes, while small blocks are suitable for frequent writes of small files.
Is it a Temporary Solution?
Yes
Suggestions and Summary
None
Original Link
https://support.sangfor.com.cn/cases/list?product_id=37&type=1&category_id=31111&isOpen=true