Editing
Benchmark Hard Drive
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===== A: The difference is in handling of the write cache in RAM: ===== <source lang=bash enclose="div"> dd bs=1M count=128 if=/dev/zero of=test'' # The default behaviour of ''dd'' is to not "sync" (i.e. not ask the OS to completely write the data to disk before ''dd'' exiting). The above command will just commit your 128 MB of data into a RAM buffer (write cache) -- this will be really fast and it will show you the hugely inflated benchmark result right away. However, the server in the background is still busy, continuing to write out data from the RAM cache to disk. </source> <source lang=bash enclose="div"> dd bs=1M count=128 if=/dev/zero of=test; sync'' #Absolutely identical to the previous case, as anyone who understands how *nix shell works should surely know that adding a ''; sync'' does not affect the operation of previous command in any way, because it is executed independently, after the first command completes. So your (wrong) MB/sec value is already printed on screen while that ''sync'' is only preparing to be executed. </source> <source lang=bash enclose="div"> dd bs=1M count=128 if=/dev/zero of=test conv=fdatasync'' # This tells ''dd'' to require a complete "sync" once, right before it exits. So it commits the whole 128 MB of data, then tells the operating system: "OK, now ensure this is completely on disk", only then measures the total time it took to do all that and calculates the benchmark result. </source> <source lang=bash enclose="div"> dd bs=1M count=128 if=/dev/zero of=test oflag=dsync'' # Here ''dd'' will ask for completely synchronous output to disk, i.e. ensure that its write requests donβt even return until the submitted data is on disk. In the above example, this will mean sync'ing once per megabyte, or 128 times in total. It would probably be the slowest mode, as the write cache is basically unused at all in this case. </source>
Summary:
Please note that all contributions to RARForge may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
RARForge:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Navigation
Home
All Pages
All Files
View Categories
Recent changes
Random page
Edit this menu
Tools
What links here
Related changes
Special pages
Page information