Open
Description
Describe the bug
Currently, I am conducting tests for the creation of 50,000 PVCs. Out of these, 3,000 are independent PVCs, and the remaining 50,000 are dependent PVCs.
How to Reproduce?
- Install to CSI version 2.9.0.
- Since PVC creation consumes significant CPU resources, we should reduce the CPU allocation for all sidecars in the deployment and set the replica count of the operator to 0.
resources:
limits:
cpu: 1500m
ephemeral-storage: 25Gi
memory: 1500Mi
- Create 3000 independent PVCs and associate 20 dependent PVCs with each independent PVC (totaling 60,000 dependent PVCs).
- Note that when the number of PVCs increases, it takes more time (around 10 minutes or more) to create each PVC.
[root@saurabh5-master ~]# oc get pods
NAME READY STATUS RESTARTS AGE
ibm-spectrum-scale-csi-2bjh9 3/3 Running 2 (3h32m ago) 20h
ibm-spectrum-scale-csi-5qrsp 3/3 Running 3 (116m ago) 20h
ibm-spectrum-scale-csi-attacher-79849cffcb-c8kbd 1/1 Running 0 20h
ibm-spectrum-scale-csi-attacher-79849cffcb-r78rp 1/1 Running 0 20h
ibm-spectrum-scale-csi-provisioner-6fb458cb77-5npbm 1/1 Running 2 (3h32m ago) 20h
ibm-spectrum-scale-csi-resizer-78b6699ff4-m7p2w 1/1 Running 0 20h
ibm-spectrum-scale-csi-snapshotter-59fb55f65b-7vhnk 1/1 Running 0 20h
[root@saurabh5-master ~]# kubectl top pod --namespace ibm-spectrum-scale-csi-driver
NAME CPU(cores) MEMORY(bytes)
ibm-spectrum-scale-csi-2bjh9 2m 50Mi
ibm-spectrum-scale-csi-5qrsp 1m 37Mi
ibm-spectrum-scale-csi-attacher-79849cffcb-c8kbd 1m 379Mi
ibm-spectrum-scale-csi-attacher-79849cffcb-r78rp 1m 14Mi
ibm-spectrum-scale-csi-provisioner-6fb458cb77-5npbm 35m 684Mi
ibm-spectrum-scale-csi-resizer-78b6699ff4-m7p2w 1m 660Mi
ibm-spectrum-scale-csi-snapshotter-59fb55f65b-7vhnk 1m 18Mi
[root@saurabh5-master ~]# oc get pvc -A | wc -l
45120
[root@saurabh5-master ~]# oc get pvc | grep scale-fset-dependent-sc-2107-pvc-1
scale-fset-dependent-sc-2107-pvc-1 Bound pvc-99206a74-3840-47b0-9055-eb217b982bfb 1Gi RWX ibm-spectrum-scale-csi-fileset-dependent-2107 21m
Scripts used :
- For creation of independent PVC :
[root@saurabh5-master 50K]# cat sc.yaml
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: ibm-spectrum-scale-csi-fileset-independent
provisioner: spectrumscale.csi.ibm.com
parameters:
volBackendFs: "fs1"
inodeLimit: "1024"
reclaimPolicy: Delete
[root@saurabh5-master 50K]# cat pvc.sh
#!/bin/bash
for (( i=1 ; i<=$1 ; i++ ))
do
echo "apiVersion: v1"> test.yaml
echo "kind: PersistentVolumeClaim">> test.yaml
echo "metadata:">> test.yaml
echo " name: scale-fset-independent-pvc-$i">> test.yaml
echo "spec:">> test.yaml
echo " accessModes:">> test.yaml
echo " - ReadWriteMany">> test.yaml
echo " resources:">> test.yaml
echo " requests:">> test.yaml
echo " storage: 1Gi">> test.yaml
echo " storageClassName: ibm-spectrum-scale-csi-fileset-independent">> test.yaml
kubectl apply -f test.yaml
done
- For creation of dependent pvc :
First we need to collect all the independent fileset names of which we will provide it for dependent pvc :
[root@saurabh5-master dep]# cat 3000sc.sh
#!/bin/bash
read -p "Enter the path to the file: " file_path
if [[ ! -f "$file_path" ]]; then
echo "File not found: $file_path"
exit 1
fi
# Read the file line by line
i=1
while IFS= read -r line; do
# Process each line
echo "apiVersion: storage.k8s.io/v1"> testsc.yaml
echo "kind: StorageClass">> testsc.yaml
echo "metadata:">> testsc.yaml
echo " name: ibm-spectrum-scale-csi-fileset-dependent-$i">> testsc.yaml
echo "provisioner: spectrumscale.csi.ibm.com">> testsc.yaml
echo "parameters:">> testsc.yaml
echo " volBackendFs: fs1">> testsc.yaml
echo " filesetType: dependent">> testsc.yaml
echo " parentFileset: $line">> testsc.yaml
echo "reclaimPolicy: Delete">> testsc.yaml
kubectl apply -f testsc.yaml
i=$((i+1))
done < "$file_path"
Creating dependent 50,000 PVCs: (we are creating pvc in batches of 20)
[root@saurabh5-master dep]# cat apply.sh
#!/bin/bash
for ((i=1; i<=3000; i++))
do
while true; do
pending_count=$(oc get pvc | grep Pending | wc -l)
if [ "$pending_count" -eq 0 ]; then
echo "All PVCs are in a bound state. Proceeding..."
break
else
echo "There are $pending_count PVC(s) in a pending state. Waiting..."
#sleep 10
fi
done
for ((j=1; j<=20; j++))
do
echo "apiVersion: v1"> test.yaml
echo "kind: PersistentVolumeClaim">> test.yaml
echo "metadata:">> test.yaml
echo " name: scale-fset-dependent-sc-$i-pvc-$j">> test.yaml
echo "spec:">> test.yaml
echo " accessModes:">> test.yaml
echo " - ReadWriteMany">> test.yaml
echo " resources:">> test.yaml
echo " requests:">> test.yaml
echo " storage: 1Gi">> test.yaml
echo " storageClassName: ibm-spectrum-scale-csi-fileset-dependent-$i">> test.yaml
kubectl apply -f test.yaml
done
done
Expected behavior
PVC creation should take less time
Data Collection and Debugging
CSI Snap : /scale-csi/D.993