Editing
Benchmark Hard Drive
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!
==Linux== ==='''DD'''=== * http://romanrm.ru/en/dd-benchmark ===== Q: What is the difference between the following? ===== <source lang=bash> dd bs=1M count=128 if=/dev/zero of=test dd bs=1M count=128 if=/dev/zero of=test; sync dd bs=1M count=128 if=/dev/zero of=test conv=fdatasync dd bs=1M count=128 if=/dev/zero of=test oflag=dsync </source> ===== 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> ===== '''Which one do you suggest?''' ===== <source lang=bash highlight="1" > dd bs=1M count=128 if=/dev/zero of=test conv=fdatasync # This behaviour is perhaps the closest to the way real-world tasks behave. If your server or VPS is really fast and the above test completes in a second or less, try increasing the ''count='' number to 1024 or so, to get a more accurate averaged result. </source> === '''Bonnie++''' === There are two parts to the bonnie++ ‘benchmark.’ The first part works with large files and the second part tests with small files. As the bonnie++man page states, the first part simulates what would happen to a filesystem when being used as a database server, while the second part is good for things like a mail cache or for a cluster node hosting a large number of small output files that need processing. The primary output of Bonnie++ is a human-readable, plain-text in 80 columns, which is designed to fit well when pasted into email and which will work well in most terminals. The second type of output is CSV (Comma Seperated Values). This can easily be imported into any spreadsheet, database or graphing tool. * '''Sequential Output = writes''' * '''Sequential Input = reads''' <source lang=bash enclose=div> mkdir ./foo bonnie++ -d ./foo/ Writing a byte at a time...done Writing intelligently...done Rewriting...done Reading a byte at a time...done Reading intelligently...done start em...done...done...done...done...done... Create files in sequential order...done. Stat files in sequential order...done. Delete files in sequential order...done. Create files in random order...done. Stat files in random order...done. Delete files in random order...done. Version 1.96 ------Sequential Output------ --Sequential Input- --Random- Concurrency 1 -Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks-- Machine Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP /sec %CP hopstore 15392M 964 96 486390 35 211723 16 4513 95 537595 16 350.3 8 Latency 8350us 205ms 567ms 31617us 43317us 92862us Version 1.96 ------Sequential Create------ --------Random Create-------- hopstore -Create-- --Read--- -Delete-- -Create-- --Read--- -Delete-- files /sec %CP /sec %CP /sec %CP /sec %CP /sec %CP /sec %CP 16 19712 16 +++++ +++ +++++ +++ +++++ +++ +++++ +++ +++++ +++ Latency 16638us 270us 282us 113us 6us 48us 1.96,1.96,hopstore,1,1362613531,15392M,,964,96,486390,35,211723,16,4513,95,537595,16,350.3,8,16,,,,,19712,16,+++++,+++,+++++,+++,+++++,+++,+++++,+++,+++++,+++,8350us,205ms,567ms,31617us,43317us,92862us,16638us,270us,282us,113us,6us,48us </source> * The last line in the output is the CSV. You can use 'bon_csv2txt' or 'bon_csv2html' to see the output. <source lang=bash enclose=div> echo 1.96,1.96,hopstore,1,1362613531,15392M,,964,96,486390,35,211723,16,4513,95,537595,16,350.3,8,16,,,,,19712,16, +++++,+++,+++++,+++,+++++,+++,+++++,+++,+++++,+++,8350us,205ms,567ms,31617us,43317us,92862us,16638us, 270us,282us,113us,6us,48us | bon_csv2txt Version 1.96 ------Sequential Output------ --Sequential Input- --Random- -Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks-- Machine Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP /sec %CP hopstore 15392M 964 96 486390 35 211723 16 4513 95 537595 16 350.3 8 Latency 8350us 205ms 567ms 31617us 43317us 92862us ------Sequential Create------ --------Random Create-------- -Create-- --Read--- -Delete-- -Create-- --Read--- -Delete-- files:max:min /sec %CP /sec %CP /sec %CP /sec %CP /sec %CP /sec %CP hopstore 16 19712 16 +++++ +++ +++++ +++ +++++ +++ +++++ +++ +++++ +++ Latency 16638us 270us 282us 113us 6us 48us </source> <source lang=bash enclose=div> echo 1.96,1.96,hopstore,1,1362613531,15392M,,964,96,486390,35,211723,16,4513,95,537595,16,350.3,8,16,,,,,19712,16, +++++,+++,+++++,+++,+++++,+++,+++++,+++,+++++,+++,8350us,205ms,567ms,31617us,43317us,92862us,16638us, 270us,282us,113us,6us,48us | bon_csv2html > disktest.html </source> * to lazy to fize the /td issue <TABLE ALIGN=center BORDER=3 CELLPADDING=2 CELLSPACING=1><TR><TD COLSPAN=2 class="header"><FONT SIZE=+1><B>Version 1.96</B></FONT></TD><TD COLSPAN=6 class="header"><FONT SIZE=+2><B>Sequential Output</B></FONT></TD><TD COLSPAN=4 class="header"><FONT SIZE=+2><B>Sequential Input</B></FONT></TD><TD COLSPAN=2 ROWSPAN=2 class="header"><FONT SIZE=+2><B>Random<BR>Seeks</B></FONT></TD><TD COLSPAN=1 class="header"></TD><TD COLSPAN=6 class="header"><FONT SIZE=+2><B>Sequential Create</B></FONT></TD><TD COLSPAN=6 class="header"><FONT SIZE=+2><B>Random Create</B></FONT></TD></TR> <TR><TD></TD><TD>Size</TD><TD COLSPAN=2>Per Char</TD><TD COLSPAN=2>Block</TD><TD COLSPAN=2>Rewrite</TD><TD COLSPAN=2>Per Char</TD><TD COLSPAN=2>Block</TD><TD>Num Files</TD><TD COLSPAN=2>Create</TD><TD COLSPAN=2>Read</TD><TD COLSPAN=2>Delete</TD><TD COLSPAN=2>Create</TD><TD COLSPAN=2>Read</TD><TD COLSPAN=2>Delete</TD></TR><TR><TD COLSPAN=2></TD><TD class="ksec"><FONT SIZE=-2>K/sec</FONT></TD><TD class="ksec"><FONT SIZE=-2>% CPU</FONT></TD><TD class="ksec"><FONT SIZE=-2>K/sec</FONT></TD><TD class="ksec"><FONT SIZE=-2>% CPU</FONT></TD><TD class="ksec"><FONT SIZE=-2>K/sec</FONT></TD><TD class="ksec"><FONT SIZE=-2>% CPU</FONT></TD><TD class="ksec"><FONT SIZE=-2>K/sec</FONT></TD><TD class="ksec"><FONT SIZE=-2>% CPU</FONT></TD><TD class="ksec"><FONT SIZE=-2>K/sec</FONT></TD><TD class="ksec"><FONT SIZE=-2>% CPU</FONT></TD><TD class="ksec"><FONT SIZE=-2>/sec</FONT></TD><TD class="ksec"><FONT SIZE=-2>% CPU</FONT></TD><TD COLSPAN=1></TD><TD class="ksec"><FONT SIZE=-2>/sec</FONT></TD><TD class="ksec"><FONT SIZE=-2>% CPU</FONT></TD><TD class="ksec"><FONT SIZE=-2>/sec</FONT></TD><TD class="ksec"><FONT SIZE=-2>% CPU</FONT></TD><TD class="ksec"><FONT SIZE=-2>/sec</FONT></TD><TD class="ksec"><FONT SIZE=-2>% CPU</FONT></TD><TD class="ksec"><FONT SIZE=-2>/sec</FONT></TD><TD class="ksec"><FONT SIZE=-2>% CPU</FONT></TD><TD class="ksec"><FONT SIZE=-2>/sec</FONT></TD><TD class="ksec"><FONT SIZE=-2>% CPU</FONT></TD><TD class="ksec"><FONT SIZE=-2>/sec</FONT></TD><TD class="ksec"><FONT SIZE=-2>% CPU</FONT></TD></TR> <TR><TD rowspan=2 bgcolor="#FFFFFF" class="rowheader"><FONT SIZE=+1>hopstore</TD><TD class="size" bgcolor="#FFFFFF">15392M</TD><TD>964</TD><TD>96</TD><TD>486390</TD><TD>35</TD><TD>211723</TD><TD>16</TD><TD>4513</TD><TD>95</TD><TD>537595</TD><TD>16</TD><TD>350.3</TD><TD>8</TD><TD class="size" bgcolor="#FFFFFF">16</TD><TD>19712</TD><TD>16</TD><TD> +++++</TD><TD>+++</TD><TD>+++++</TD><TD>+++</TD><TD>+++++</TD><TD>+++</TD><TD>+++++</TD><TD>+++</TD><TD>+++++</TD><TD>+++</TD></TR> <TR><TD class="size" bgcolor="#FFFFFF" COLSPAN=1>Latency</TD><TD COLSPAN=2>8350us</TD><TD COLSPAN=2>205ms</TD><TD COLSPAN=2>567ms</TD><TD COLSPAN=2>31617us</TD><TD COLSPAN=2>43317us</TD><TD COLSPAN=2>92862us</TD><TD class="size" bgcolor="#FFFFFF" COLSPAN=1>Latency</TD><TD COLSPAN=2>16638us</TD><TD COLSPAN=2> 270us</TD><TD COLSPAN=2>282us</TD><TD COLSPAN=2>113us</TD><TD COLSPAN=2>6us</TD><TD COLSPAN=2>48us</TD></TR> </TABLE> [[Category:How-to]] [[Category:Linux]] [[Category:Monitoring]] [[Category:Performance]]
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