I just went for some disk performance tests on my DIY NAS and noticed some very poor performace results with my NVME disk writes !
My NAS runs Debian 10 with this config :
- ASROCK X470D4U with Ryzen 5 3600
- 16 Gb ECC RAM
- 1 NVME for OS (ADATA x8200 Pro 256MB).
This is a PCIe Gen 3 x4 on a PCIe Gen 2 x2 slot, given for 3500MB/s Read & 3000MB/s Write.
- 4 SATA HDD in software RAID 6 (WD RED 10TB)
- 1 SATA HDD (WD Green 2TB)
NVME write speed : 320 MB/s !
# time ( dd if=/dev/zero of=test.img bs=1G count=10 status=progress ; sync )
10737418240 bytes (11 GB, 10 GiB) copied, 27 s, 399 MB/s
10+0 records in
10+0 records out
10737418240 bytes (11 GB, 10 GiB) copied, 33.5806 s, 320 MB/s
real 0m34.650s
user 0m0.001s
sys 0m8.943s
NVME read speed : 1,7 GB/s
# /sbin/sysctl -w vm.drop_caches=3; time ( dd if=test.img of=/dev/null bs=10G count=5 status=progress )
vm.drop_caches = 3
2147479552 bytes (2.1 GB, 2.0 GiB) copied, 1 s, 1.6 GB/s
dd: warning: partial read (2147479552 bytes); suggest iflag=fullblock
10737397760 bytes (11 GB, 10 GiB) copied, 6 s, 1.7 GB/s
0+5 records in
0+5 records out
10737397760 bytes (11 GB, 10 GiB) copied, 6.27933 s, 1.7 GB/s
real 0m6.358s
user 0m0.000s
sys 0m4.593s
For comparison, here are the results of the RAID 6 (5400 rpm) filesystem and a single HDD (5400 rpm) :
RAID 6 write speed : 275 MB/s
RAID 6 read speed : 290 MB/s
Single disk write speed : 120 MB/s
Single read speed : 125 MB/s
So, I think that the read speed is somehow normal for the NVME drive as it is plugged on a PCIe x2 slot instead of a x4 slot, so 3500 MB/s / 2 should be near the 1,7 GB/s I've found. But I can't explain the poor performance when writing...
Any idea of what is going on ?
Stéphane