简体   繁体   中英

hdparm and disk read speed

My hdparm -t buffered disk reads output is around 120 MB/sec. However, I was writing a little code that involves reading a big file (around 400MB), when I managed to read it all in about one second ( fread() on c ). Does the hdparm output not quite say what I understand? Why am I able to read so much faster?

I do very simple processing to the bytes I read, counting how many are the letter 'A'.

hdparm is bypassing your OS's cache, but your test program is taking advantage of it. Presuming you're running Linux, evict everything from the page cache with this command (source: http://linux-mm.org/Drop_Caches ):

echo 3 > /proc/sys/vm/drop_caches

Then, run your test program. It should be at or below the rate reported by hdparm.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM