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
|
1
| curl -sfL https://raw.githubusercontent.com/shaowenchen/ops/main/getcli.sh | VERSION=latest sh -
|
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
- Direct — mount straight onto a host directory
1
| mount -t nfs x.x.x.x:/x-x/ /data/
|
- Use CSI-Driver-NFS to provide NFS storage
See https://github.com/kubernetes-csi/csi-driver-nfs
- Use Fluid NFS Runtime to provide NFS storage
4.3 Test Results — 10 GB of Data
| Test Environment | IOPS | Bandwidth (MiB/s) | Time (msec) | Data Size (GiB) |
|---|
| Direct | 28.0k | 113 | 90469 | 10 |
| CSI NFS Pod | 3115 | 12.2 | 841368 | 10 |
| Fluid NFS Pod | 28.2k | 110 | 93052 | 10 |
| Test Environment | IOPS | Bandwidth (MiB/s) | Time (msec) | Data Size (GiB) |
|---|
| Direct | 28.6k | 112 | 91775 | 10 |
| CSI NFS Pod | 3217 | 12.6 | 814718 | 10 |
| Fluid NFS Pod | 29.2k | 114 | 89678 | 10 |
| Test Environment | IOPS | Bandwidth (MiB/s) | Time (msec) | Data Size (GiB) |
|---|
| Direct | 3029 | 379 | 27043 | 10 |
| CSI NFS Pod | 1150 | 144 | 71226 | 10 |
| Fluid NFS Pod | 2606 | 326 | 31428 | 10 |
| Test Environment | IOPS | Bandwidth (MiB/s) | Time (msec) | Data Size (GiB) |
|---|
| Direct | 3092 | 387 | 26489 | 10 |
| CSI NFS Pod | 1154 | 144 | 70946 | 10 |
| Fluid NFS Pod | 2300 | 288 | 35605 | 10 |
| Test Environment | IOPS | Bandwidth (MiB/s) | Time (msec) | Data Size (GiB) |
|---|
| Direct | 10.5k | 40.0 | 249817 | 10 |
| CSI NFS Pod | 3107 | 12.1 | 843484 | 10 |
| Fluid NFS Pod | 9202 | 35.9 | 284852 | 10 |
- Random Write IOPS Testing
| Test Environment | IOPS | Bandwidth (MiB/s) | Time (msec) | Data Size (GiB) |
|---|
| Direct | 14.2k | 55.6 | 184205 | 10 |
| CSI NFS Pod | 3148 | 12.3 | 832589 | 10 |
| Fluid NFS Pod | 12.0k | 50.6 | 202321 | 10 |
4.4 Test Results — 1 GB of Data
| Test Environment | IOPS | Bandwidth (MiB/s) | Time (msec) | Data Size (MiB) |
|---|
| Direct | 27.2k | 106 | 9648 | 1024 |
| CSI NFS Pod | 20.3k | 79.4 | 12901 | 1024 |
| Fluid NFS Pod | 36.1k | 141 | 7255 | 1024 |
| Test Environment | IOPS | Bandwidth (MiB/s) | Time (msec) | Data Size (MiB) |
|---|
| Direct | 27.6k | 108 | 9489 | 1024 |
| CSI NFS Pod | 28.3k | 110 | 9275 | 1024 |
| Fluid NFS Pod | 20.5k | 80.3 | 12759 | 1024 |
| Test Environment | IOPS | Bandwidth (MiB/s) | Time (msec) | Data Size (MiB) |
|---|
| Direct | 4291 | 536 | 1909 | 1024 |
| CSI NFS Pod | 1125 | 141 | 7280 | 1024 |
| Fluid NFS Pod | 4662 | 583 | 1757 | 1024 |
| Test Environment | IOPS | Bandwidth (MiB/s) | Time (msec) | Data Size (MiB) |
|---|
| Direct | 4689 | 586 | 1747 | 1024 |
| CSI NFS Pod | 1161 | 145 | 7052 | 1024 |
| Fluid NFS Pod | 3803 | 475 | 2154 | 1024 |
| Test Environment | IOPS | Bandwidth (MiB/s) | Time (msec) | Data Size (MiB) |
|---|
| Direct | 15.5k | 60.7 | 16871 | 1024 |
| CSI NFS Pod | 14.4k | 56.3 | 18195 | 1024 |
| Fluid NFS Pod | 15.0k | 58.8 | 17419 | 1024 |
- Random Write IOPS Testing
| Test Environment | IOPS | Bandwidth (MiB/s) | Time (msec) | Data Size (MiB) |
|---|
| Direct | 13.1k | 51.1 | 20020 | 1024 |
| CSI NFS Pod | 15.0k | 62.4 | 16423 | 1024 |
| Fluid NFS Pod | 13.2k | 51.5 | 19875 | 1024 |
4.5 Test Results — 100 MB of Data
Okay, I will organize all the test cases according to the format you provided.
| Test Environment | IOPS | Bandwidth (MiB/s) | Time (msec) | Data Size (MiB) |
|---|
| Direct | 14.3k | 55.7 | 1794 | 100 |
| CSI NFS Pod | 28.1k | 110 | 912 | 100 |
| Fluid NFS Pod | 37.0k | 145 | 691 | 100 |
| Test Environment | IOPS | Bandwidth (MiB/s) | Time (msec) | Data Size (MiB) |
|---|
| Direct | 26.5k | 104 | 966 | 100 |
| CSI NFS Pod | 29.4k | 115 | 872 | 100 |
| Fluid NFS Pod | 9052 | 35.4 | 2828 | 100 |
| Test Environment | IOPS | Bandwidth (MiB/s) | Time (msec) | Data Size (MiB) |
|---|
| Direct | 3603 | 450 | 222 | 100 |
| CSI NFS Pod | 1568 | 196 | 510 | 100 |
| Fluid NFS Pod | 6779 | 847 | 118 | 100 |
| Test Environment | IOPS | Bandwidth (MiB/s) | Time (msec) | Data Size (MiB) |
|---|
| Direct | 6666 | 833 | 120 | 100 |
| CSI NFS Pod | 6349 | 794 | 126 | 100 |
| Fluid NFS Pod | 6451 | 806 | 124 | 100 |
| Test Environment | IOPS | Bandwidth (MiB/s) | Time (msec) | Data Size (MiB) |
|---|
| Direct | 15.4k | 60.0 | 1666 | 100 |
| CSI NFS Pod | 14.6k | 56.8 | 1759 | 100 |
| Fluid NFS Pod | 15.4k | 60.2 | 1660 | 100 |
| Test Environment | IOPS | Bandwidth (MiB/s) | Time (msec) | Data Size (MiB) |
|---|
| Direct | 13.5k | 52.6 | 1900 | 100 |
| CSI NFS Pod | 15.8k | 61.9 | 1616 | 100 |
| Fluid NFS Pod | 13.2k | 51.4 | 1944 | 100 |
- Rand_Read_Latency_Testing
| Test Environment | IOPS | Bandwidth (kB/s) | Time (msec) | Data Size (MiB) |
|---|
| Direct | 496 | 1985 | 51594 | 100 |
| CSI NFS Pod | 579 | 2319 | 44159 | 100 |
| Fluid NFS Pod | 458 | 1833 | 55868 | 100 |
- Rand_Write_Latency_Testing
| Test Environment | IOPS | Bandwidth (kB/s) | Time (msec) | Data Size (MiB) |
|---|
| Direct | 458 | 1836 | 55785 | 100 |
| CSI NFS Pod | 575 | 2301 | 44495 | 100 |
| Fluid NFS Pod | 444 | 1776 | 57651 | 100 |
4.5 Conclusion
Mounting NFS directly gives the best performance, but under Kubernetes it can only be mounted via HostPath, which makes it inconvenient to use.
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.
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.