TLDR;Raspberry Pi 4 上的 USB-3 SSD 的读取速度为 322KiB/s,写入速度为 108KiB/s,预计至少为 MB/s……
我已经浏览过关于这个的每个论坛,使用这个测试:
sudo fio --randrepeat=1 --ioengine=libaio --direct=1 --gtod_reduce=1 --name=test --filename=test --bs=4k --iodepth=64 --size=4G --readwrite=randrw --rwmixread=75
我得到了以下结果:
test: (groupid=0, jobs=1): err= 0: pid=29327: Mon Oct 17 01:54:05 2022
read: IOPS=80, BW=322KiB/s (330kB/s)(3070MiB/9752067msec)
bw ( KiB/s): min= 32, max= 640, per=100.00%, avg=322.30, stdev=56.10, samples=19503
iops : min= 8, max= 160, avg=80.53, stdev=14.03, samples=19503
write: IOPS=26, BW=108KiB/s (110kB/s)(1026MiB/9752067msec); 0 zone resets
bw ( KiB/s): min= 7, max= 240, per=100.00%, avg=107.68, stdev=30.44, samples=19502
iops : min= 1, max= 60, avg=26.87, stdev= 7.61, samples=19502
cpu : usr=0.19%, sys=1.23%, ctx=1066066, majf=0, minf=18
IO depths : 1=0.1%, 2=0.1%, 4=0.1%, 8=0.1%, 16=0.1%, 32=0.1%, >=64=100.0%
submit : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
complete : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.1%, >=64=0.0%
issued rwts: total=785920,262656,0,0 short=0,0,0,0 dropped=0,0,0,0
latency : target=0, window=0, percentile=100.00%, depth=64
Run status group 0 (all jobs):
READ: bw=322KiB/s (330kB/s), 322KiB/s-322KiB/s (330kB/s-330kB/s), io=3070MiB (3219MB), run=9752067-9752067msec
WRITE: bw=108KiB/s (110kB/s), 108KiB/s-108KiB/s (110kB/s-110kB/s), io=1026MiB (1076MB), run=9752067-9752067msec
Disk stats (read/write):
sdc: ios=785603/312743, merge=310/2356, ticks=16335446/3116502, in_queue=17370112, util=100.00%
系统设置是 raspberry pi 4 硬件上的 64 位 Ubuntu(内核5.4.0-1071-raspi
),已确认我正在从 dmesg“使用 xhci_hcd”驱动程序,也没有错误。
尝试在 cmdline.txt 中为设备添加“usb-storage.quirks”,但没有任何变化。
SSD 是
[436294.004115] usb 2-2: Product: Elements 2621
[436294.004126] usb 2-2: Manufacturer: Western Digital
还有谁在 Pi 4 设置中看到了这个问题,可以提供帮助吗?
答案1
您正在执行的randrw
操作当然比顺序 rw 操作慢得多,尤其是在旋转 HDD 上,甚至通过 USB 执行得更慢。
来自fio
文档:
readwrite=str, rw=str
Type of I/O pattern. Accepted values are:
read
Sequential reads.
write
Sequential writes.
trim
Sequential trims (Linux block devices and SCSI character devices only).
randread
Random reads.
randwrite
Random writes.
randtrim
Random trims (Linux block devices and SCSI character devices only).
rw,readwrite
Sequential mixed reads and writes.
randrw
Random mixed reads and writes.
trimwrite
Sequential trim+write sequences. Blocks will be trimmed first, then the same blocks will be written to. So if io_size=64K is specified, Fio will trim a total of 64K bytes and also write 64K bytes on the same trimmed blocks. This behaviour will be consistent with number_ios or other Fio options limiting the total bytes or number of I/O’s.
randtrimwrite
Like trimwrite, but uses random offsets rather than sequential writes.