为什么HDSD的基准在hdparm和dd工具之间是不同的?

问题描述 投票:0回答:0

我看到一些工具可以帮助测试HDSD的速度(阅读撰写).

hdparmdd

我用这些工具做了一些基准测试。

输入: 缓冲区大小= 932 甲基溴

  • 读取速度 dd: 536 MBs
  • 写入速度与 dd: 492 MBs
  • 读取速度 hdparm: 310.51 MBs

取消缓存。

root@tech_expert:/home/tech_expert# hdparm -W0 /dev/sda5

/dev/sda5:
 setting drive write-caching to 0 (off)
 write-caching =  0 (off)

用hdparm读取速度(缓存丢弃)

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

使用dd的写入速度(缓存丢弃

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

使用hdparm的读取速度(使用缓存)

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

读取速度与dd(缓存丢弃)

保留 "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

读取速度与dd(缓存使用)

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年的工具差别很大。

我不知道我应该相信哪个结果更可信?

benchmarking
© www.soinside.com 2019 - 2024. All rights reserved.