mdadm RAID0 的寫入速度奇怪

mdadm RAID0 的寫入速度奇怪

我剛剛為帶有兩個 5400rpm 2.5'' HDD 的 RAID0 設定了 mdadm。

透過使用 dd 執行寫入速度測試:

dd if=/dev/zero of=./largefile bs=1M count=3000

我得到:

3000+0 筆記錄

3000+0筆記錄輸出

複製 3145728000 位元組(3.1 GB,2.9GiB),0.986443 秒,3.2 GB/秒

這顯然沒有意義 - 通過複製和打開文件進行測試,驅動器確實工作正常。

有人知道這是怎麼回事嗎?

答案1

使用oflag=同步選項,您將看到相關的速度:

dd if=/dev/zero of=./largefile bs=1M count=3000 oflag=sync

答案2

與我的單一 NMVe M.2 SSD 進行比較:

$ dd if=/dev/zero of=./largefile bs=1M count=3000
3000+0 records in
3000+0 records out
3145728000 bytes (3.1 GB, 2.9 GiB) copied, 1.98838 s, 1.6 GB/s

$ dd if=/dev/zero of=./largefile bs=1M count=3000 oflag=sync
3000+0 records in
3000+0 records out
3145728000 bytes (3.1 GB, 2.9 GiB) copied, 23.9874 s, 131 MB/s

$ time cp -a ./largefile ./largefile2

real    0m4.738s
user    0m0.021s
sys     0m2.811s

檔案大小為 3 GB / 4.738 秒 = 633 MB/秒。dd每個測試場景中的錯誤測量尺也是如此。我將用作cp現實世界的測試。

相關內容