我看到一些工具可以帮助测试HDSD的速度(阅读 和 撰写).
hdparm 和 dd
我用这些工具做了一些基准测试。
输入: 缓冲区大小= 932 甲基溴
root@tech_expert:/home/tech_expert# hdparm -W0 /dev/sda5
/dev/sda5:
setting drive write-caching to 0 (off)
write-caching = 0 (off)
root@tech_expert:/home/tech_expert# sync; echo 3 > /proc/sys/vm/drop_caches
root@tech_expert:/home/tech_expert# time sh -c "sudo hdparm -t /dev/sda5 && sync"
/dev/sda5:
Timing buffered disk reads: 932 MB in 3.00 seconds = 310.51 MB/sec
real 0m6.229s
user 0m0.032s
sys 0m0.798s
root@tech_expert:/home/tech_expert# sync; echo 3 > /proc/sys/vm/drop_caches
root@tech_expert:/home/tech_expert# time sh -c "dd if=/dev/zero of=test bs=8k count=113800 && sync"; rm -f test
113800+0 records in
113800+0 records out
932249600 bytes (932 MB, 889 MiB) copied, 1.89512 s, 492 MB/s
real 0m2.686s
user 0m0.018s
sys 0m0.904s
root@tech_expert:/home/tech_expert# time sh -c "sudo hdparm -T /dev/sda5 && sync"
/dev/sda5:
Timing cached reads: 23848 MB in 1.99 seconds = 11964.42 MB/sec
real 0m7.127s
user 0m0.260s
sys 0m1.781s
保留 "test "文件并执行下面的命令。
root@tech_expert:/home/tech_expert# time sh -c "dd if=test of=/dev/null bs=8k count=113800 && sync"
113800+0 records in
113800+0 records out
932249600 bytes (932 MB, 889 MiB) copied, 1.73958 s, 536 MB/s
real 0m1.775s
user 0m0.098s
sys 0m0.732s
root@tech_expert:/home/tech_expert# time sh -c "dd if=test of=/dev/null bs=8k count=113800 && sync"
113800+0 records in
113800+0 records out
932249600 bytes (932 MB, 889 MiB) copied, 0.198455 s, 4.7 GB/s
real 0m0.230s
user 0m0.026s
sys 0m0.175s
02年的工具差别很大。
我不知道我应该相信哪个结果更可信?