This page looks best with JavaScript enabled

Fluid Using NFS Runtime and Performance Testing

 ·  ☕ 5 min read

1. Creating a Dataset

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
kubectl apply -f - <<EOF
apiVersion: data.fluid.io/v1alpha1
kind: Dataset
metadata:
  name: nfs-demo
spec:
  mounts:
  - mountPoint: x.x.x.x:/x-x/
    name: nfs-demo
EOF

2. Creating a Runtime

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
kubectl apply -f - <<EOF
apiVersion: data.fluid.io/v1alpha1
kind: ThinRuntimeProfile
metadata:
  name: nfs
spec:
  fileSystemType: nfs
  fuse:
    image: fluidcloudnative/nfs
    imageTag: v0.1
    imagePullPolicy: IfNotPresent
    command:
      - "/usr/local/bin/entrypoint.sh"
EOF
1
2
3
4
5
6
7
8
kubectl apply -f - <<EOF
apiVersion: data.fluid.io/v1alpha1
kind: ThinRuntime
metadata:
  name: nfs-demo
spec:
  profileName: nfs
EOF

3. Creating a Test Pod

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
kubectl apply -f - <<EOF
apiVersion: v1
kind: Pod
metadata:
  name: nfs-demo
spec:
  containers:
    - name: nfs-demo
      image: shaowenchen/demo:ubuntu
      volumeMounts:
        - mountPath: /data
          name: nfs-demo
  volumes:
    - name: nfs-demo
      persistentVolumeClaim:
        claimName: nfs-demo
EOF

4. Performance Testing

4.1 Testing Tools

  • Install the Opscli tool
1
curl -sfL https://raw.githubusercontent.com/shaowenchen/ops/main/getcli.sh | VERSION=latest sh -
  • Test command
1
opscli task --filepath  ~/.ops/tasks/get-diskio-byfio.yaml --filename ./testfile --size 10g -i 127.0.0.1

4.2 Three Ways to Mount NFS

  1. Direct — mount straight onto a host directory
1
mount -t nfs x.x.x.x:/x-x/ /data/
  1. Use CSI-Driver-NFS to provide NFS storage

See https://github.com/kubernetes-csi/csi-driver-nfs

  1. Use Fluid NFS Runtime to provide NFS storage

4.3 Test Results — 10 GB of Data

  • Random Read Testing
Test EnvironmentIOPSBandwidth (MiB/s)Time (msec)Data Size (GiB)
Direct28.0k1139046910
CSI NFS Pod311512.284136810
Fluid NFS Pod28.2k1109305210
  • Random Write Testing
Test EnvironmentIOPSBandwidth (MiB/s)Time (msec)Data Size (GiB)
Direct28.6k1129177510
CSI NFS Pod321712.681471810
Fluid NFS Pod29.2k1148967810
  • Sequential Read Testing
Test EnvironmentIOPSBandwidth (MiB/s)Time (msec)Data Size (GiB)
Direct30293792704310
CSI NFS Pod11501447122610
Fluid NFS Pod26063263142810
  • Sequential Write Testing
Test EnvironmentIOPSBandwidth (MiB/s)Time (msec)Data Size (GiB)
Direct30923872648910
CSI NFS Pod11541447094610
Fluid NFS Pod23002883560510
  • Random Read IOPS Testing
Test EnvironmentIOPSBandwidth (MiB/s)Time (msec)Data Size (GiB)
Direct10.5k40.024981710
CSI NFS Pod310712.184348410
Fluid NFS Pod920235.928485210
  • Random Write IOPS Testing
Test EnvironmentIOPSBandwidth (MiB/s)Time (msec)Data Size (GiB)
Direct14.2k55.618420510
CSI NFS Pod314812.383258910
Fluid NFS Pod12.0k50.620232110

4.4 Test Results — 1 GB of Data

  • Random Read Testing
Test EnvironmentIOPSBandwidth (MiB/s)Time (msec)Data Size (MiB)
Direct27.2k10696481024
CSI NFS Pod20.3k79.4129011024
Fluid NFS Pod36.1k14172551024
  • Random Write Testing
Test EnvironmentIOPSBandwidth (MiB/s)Time (msec)Data Size (MiB)
Direct27.6k10894891024
CSI NFS Pod28.3k11092751024
Fluid NFS Pod20.5k80.3127591024
  • Sequential Read Testing
Test EnvironmentIOPSBandwidth (MiB/s)Time (msec)Data Size (MiB)
Direct429153619091024
CSI NFS Pod112514172801024
Fluid NFS Pod466258317571024
  • Sequential Write Testing
Test EnvironmentIOPSBandwidth (MiB/s)Time (msec)Data Size (MiB)
Direct468958617471024
CSI NFS Pod116114570521024
Fluid NFS Pod380347521541024
  • Random Read IOPS Testing
Test EnvironmentIOPSBandwidth (MiB/s)Time (msec)Data Size (MiB)
Direct15.5k60.7168711024
CSI NFS Pod14.4k56.3181951024
Fluid NFS Pod15.0k58.8174191024
  • Random Write IOPS Testing
Test EnvironmentIOPSBandwidth (MiB/s)Time (msec)Data Size (MiB)
Direct13.1k51.1200201024
CSI NFS Pod15.0k62.4164231024
Fluid NFS Pod13.2k51.5198751024

4.5 Test Results — 100 MB of Data

Okay, I will organize all the test cases according to the format you provided.

  • Rand_Read_Testing
Test EnvironmentIOPSBandwidth (MiB/s)Time (msec)Data Size (MiB)
Direct14.3k55.71794100
CSI NFS Pod28.1k110912100
Fluid NFS Pod37.0k145691100
  • Rand_Write_Testing
Test EnvironmentIOPSBandwidth (MiB/s)Time (msec)Data Size (MiB)
Direct26.5k104966100
CSI NFS Pod29.4k115872100
Fluid NFS Pod905235.42828100
  • Sequ_Read_Testing
Test EnvironmentIOPSBandwidth (MiB/s)Time (msec)Data Size (MiB)
Direct3603450222100
CSI NFS Pod1568196510100
Fluid NFS Pod6779847118100
  • Sequ_Write_Testing
Test EnvironmentIOPSBandwidth (MiB/s)Time (msec)Data Size (MiB)
Direct6666833120100
CSI NFS Pod6349794126100
Fluid NFS Pod6451806124100
  • Rand_Read_IOPS_Testing
Test EnvironmentIOPSBandwidth (MiB/s)Time (msec)Data Size (MiB)
Direct15.4k60.01666100
CSI NFS Pod14.6k56.81759100
Fluid NFS Pod15.4k60.21660100
  • Rand_Write_IOPS_Testing
Test EnvironmentIOPSBandwidth (MiB/s)Time (msec)Data Size (MiB)
Direct13.5k52.61900100
CSI NFS Pod15.8k61.91616100
Fluid NFS Pod13.2k51.41944100
  • Rand_Read_Latency_Testing
Test EnvironmentIOPSBandwidth (kB/s)Time (msec)Data Size (MiB)
Direct496198551594100
CSI NFS Pod579231944159100
Fluid NFS Pod458183355868100
  • Rand_Write_Latency_Testing
Test EnvironmentIOPSBandwidth (kB/s)Time (msec)Data Size (MiB)
Direct458183655785100
CSI NFS Pod575230144495100
Fluid NFS Pod444177657651100

4.5 Conclusion

  • Direct

Mounting NFS directly gives the best performance, but under Kubernetes it can only be mounted via HostPath, which makes it inconvenient to use.

  • CSI NFS Pod

Its read/write performance on small files is very good, making it suitable for scenarios such as storing code, but its advantage over the other approaches is not obvious.

  • Fluid NFS Pod

The NFS performance provided by Fluid Runtime is not far off from a direct mount, because the Fuse Pod works by mounting the NFS directory onto the current host directory.


微信公众号
WRITTEN BY
微信公众号