zvfs: 性能测试

This commit is contained in:
2026-02-24 16:01:29 +00:00
parent 6f8f2148c3
commit 8d1d9506cd
7 changed files with 779 additions and 48 deletions

254
README.md
View File

@@ -6,9 +6,263 @@ cd /home/lian/share/10.1-spdk/spdk
make -j
make
# sometimes dd if=/dev/zero of=/dev/nvme0n1 bs=1M count=10
LD_PRELOAD=./libzvfs.so ./func_test
```
## 测试
```shell
cd /home/lian/share/10.1-spdk/spdk
export LD_LIBRARY_PATH=/home/lian/share/10.1-spdk/spdk/build/lib:/home/lian/share/10.1-spdk/spdk/dpdk/build/lib:$LD_LIBRARY_PATH
export PATH=/home/lian/share/10.1-spdk/spdk/build/bin:$PATH
./build/bin/spdk_nvme_perf \
-r 'trtype:PCIe traddr:0000:03:00.0' \
-q 1 -o 4096 -w randwrite -t 5
root@ubuntu:/home/lian/share/10.1-spdk/spdk# ./build/bin/spdk_nvme_perf -r 'trtype:PCIe traddr:0000:03:00.0' -q 1 -o 4096 -w randwrite -t 5
Initializing NVMe Controllers
Attached to NVMe Controller at 0000:03:00.0 [15ad:07f0]
Associating PCIE (0000:03:00.0) NSID 1 with lcore 0
Initialization complete. Launching workers.
========================================================
Latency(us)
Device Information : IOPS MiB/s Average min max
PCIE (0000:03:00.0) NSID 1 from core 0: 22097.20 86.32 45.21 21.93 1639.58
========================================================
Total : 22097.20 86.32 45.21 21.93 1639.58
./build/bin/spdk_nvme_perf \
-r 'trtype:PCIe traddr:0000:03:00.0' \
-q 32 -o 4096 -w randwrite -t 5
root@ubuntu:/home/lian/share/10.1-spdk/spdk# ./build/bin/spdk_nvme_perf -r 'trtype:PCIe traddr:0000:03:00.0' -q 32 -o 4096 -w randwrite -t 5
Initializing NVMe Controllers
Attached to NVMe Controller at 0000:03:00.0 [15ad:07f0]
Associating PCIE (0000:03:00.0) NSID 1 with lcore 0
Initialization complete. Launching workers.
========================================================
Latency(us)
Device Information : IOPS MiB/s Average min max
PCIE (0000:03:00.0) NSID 1 from core 0: 80122.94 312.98 399.36 36.31 2225.64
========================================================
Total : 80122.94 312.98 399.36 36.31 2225.64
./build/bin/spdk_nvme_perf \
-r 'trtype:PCIe traddr:0000:03:00.0' \
-q 1 -o 131072 -w write -t 5
root@ubuntu:/home/lian/share/10.1-spdk/spdk# export LD_LIBRARY_PATH=/home/lian/share/10.1-spdk/spdk/build/lib:/home/lian/share/10.1-spdk/spdk/dpdk/build/lib:$LD_LIBRARY_PATH
root@ubuntu:/home/lian/share/10.1-spdk/spdk# export PATH=/home/lian/share/10.1-spdk/spdk/build/bin:$PATH
root@ubuntu:/home/lian/share/10.1-spdk/spdk# ./build/bin/spdk_nvme_perf -r 'trtype:PCIe traddr:0000:03:00.0' -q 1 -o 131072 -w write -t 5
Initializing NVMe Controllers
Attached to NVMe Controller at 0000:03:00.0 [15ad:07f0]
Associating PCIE (0000:03:00.0) NSID 1 with lcore 0
Initialization complete. Launching workers.
========================================================
Latency(us)
Device Information : IOPS MiB/s Average min max
PCIE (0000:03:00.0) NSID 1 from core 0: 14746.80 1843.35 67.79 40.16 4324.96
========================================================
Total : 14746.80 1843.35 67.79 40.16 4324.96
./build/bin/spdk_nvme_perf \
-r 'trtype:PCIe traddr:0000:03:00.0' \
-q 32 -o 131072 -w write -t 5
root@ubuntu:/home/lian/share/10.1-spdk/spdk# ./build/bin/spdk_nvme_perf -r 'trtype:PCIe traddr:0000:03:00.0' -q 32 -o 131072 -w write -t 5
Initializing NVMe Controllers
Attached to NVMe Controller at 0000:03:00.0 [15ad:07f0]
Associating PCIE (0000:03:00.0) NSID 1 with lcore 0
Initialization complete. Launching workers.
========================================================
Latency(us)
Device Information : IOPS MiB/s Average min max
PCIE (0000:03:00.0) NSID 1 from core 0: 21997.40 2749.68 1455.09 96.64 26152.13
========================================================
Total : 21997.40 2749.68 1455.09 96.64 26152.13
```
### 系统调用
#### no O_DIRECT 小块
```shell
root@ubuntu:/home/lian/share/10.1-spdk/zvfs# ./func_test
=== test_single_file_perf ===
Path : /tmp/test.dat
IO size : 4 KB
Max file: 2048 MB
Duration: 10 sec
WRITE:
total : 12668.9 MB
time : 10.003 sec
IOPS : 324211 ops/sec
BW : 1266.45 MB/s
READ:
total : 7664.5 MB
time : 10.000 sec
IOPS : 196210 ops/sec
BW : 766.44 MB/s
=== all tests PASSED ===
```
#### no O_DIRECT 大块
```shell
root@ubuntu:/home/lian/share/10.1-spdk/zvfs# ./func_test
=== test_single_file_perf ===
Path : /tmp/test.dat
IO size : 128 KB
Max file: 2048 MB
Duration: 10 sec
WRITE:
total : 14609.5 MB
time : 10.000 sec
IOPS : 11688 ops/sec
BW : 1460.95 MB/s
READ:
total : 8138.6 MB
time : 10.000 sec
IOPS : 6511 ops/sec
BW : 813.85 MB/s
=== all tests PASSED ===
```
#### O_DIRECT 小块
```shell
root@ubuntu:/home/lian/share/10.1-spdk/zvfs# ./func_test
=== test_single_file_perf ===
Path : /tmp/test.dat
IO size : 4 KB
Max file: 2048 MB
Duration: 10 sec
WRITE:
total : 434.5 MB
time : 10.000 sec
IOPS : 11122 ops/sec
BW : 43.45 MB/s
READ:
total : 373.8 MB
time : 10.000 sec
IOPS : 9568 ops/sec
BW : 37.38 MB/s
=== all tests PASSED ===
```
#### O_DIRECT 大块
```shell
root@ubuntu:/home/lian/share/10.1-spdk/zvfs# ./func_test
=== test_single_file_perf ===
Path : /tmp/test.dat
IO size : 128 KB
Max file: 2048 MB
Duration: 10 sec
WRITE:
total : 7245.4 MB
time : 10.000 sec
IOPS : 5796 ops/sec
BW : 724.53 MB/s
READ:
total : 9006.5 MB
time : 10.000 sec
IOPS : 7205 ops/sec
BW : 900.64 MB/s
=== all tests PASSED ===
```
### SPDK
#### 非对齐
```shell
root@ubuntu:/home/lian/share/10.1-spdk/zvfs# LD_PRELOAD=./libzvfs.so ./func_test /zvfs
=== test_single_file_perf ===
Path : /zvfs/file.dat
IO size : 128 KB
Max file: 2048 MB
Duration: 10 sec
WRITE:
total : 10304.0 MB
time : 10.000 sec
IOPS : 8243 ops/sec
BW : 1030.40 MB/s
READ:
total : 17788.5 MB
time : 10.000 sec
IOPS : 14231 ops/sec
BW : 1778.85 MB/s
=== all tests PASSED ===
```
#### 全对齐大块
```shell
root@ubuntu:/home/lian/share/10.1-spdk/zvfs# LD_PRELOAD=./libzvfs.so ./func_test /zvfs
=== test_single_file_perf ===
Path : /zvfs/file.dat
IO size : 128 KB
Max file: 2048 MB
Duration: 10 sec
WRITE:
total : 16624.4 MB
time : 10.000 sec
IOPS : 13299 ops/sec
BW : 1662.43 MB/s
READ:
total : 16430.8 MB
time : 10.000 sec
IOPS : 13145 ops/sec
BW : 1643.07 MB/s
=== all tests PASSED ===
```
#### 全对齐小块
```shell
root@ubuntu:/home/lian/share/10.1-spdk/zvfs# LD_PRELOAD=./libzvfs.so ./func_test /zvfs
=== test_single_file_perf ===
Path : /zvfs/file.dat
IO size : 4 KB
Max file: 2048 MB
Duration: 10 sec
WRITE:
total : 944.5 MB
time : 10.000 sec
IOPS : 24179 ops/sec
BW : 94.45 MB/s
READ:
total : 982.8 MB
time : 10.000 sec
IOPS : 25159 ops/sec
BW : 98.28 MB/s
=== all tests PASSED ===
```
## SPDK
1. blob_store: blob仓库管理多个blob对象。