drive speed tests
Contents
drive speed test results -- trivial benchmarks
Raw read and write speed may not the best benchmark, but it's a start. For USB Flash drives this is usually the benchmark that I care about the most since I usually use USB Flash drives for moving large files around.
write speed in MB/s | read speed in MB/s | drive name | model number | USB ID | Notes |
---|---|---|---|---|---|
4.34 | 22.63 | SanDisk Cruzer Fit 16GB | 0781:5571 | This USB flash drive is a little nub hardly bigger than the USB plug. | |
6.36 | 19.88 | Pie Digital, Inc. PieKey 4GB | 22a6:ffff | This was from a Flash drive I worked on -- I set the PID! Pretty decent specs. | |
4.01 | 18.10 | SanDisk Cruzer 16GB | SDCZ36-016G | 0781:5530 | |
3.51 | 23.76 | Transcend Information OCZ Diesel 4GB | 1307:0165 | ||
10.27 | 17.50 | OEM 2GB | 13fe:1f00 | Impressive write speed for a cheap drive. | |
6.64 | 15.58 | Cisco Linksys Connect Easy Setup Key 1GB | NK2 | 13b1:002e | |
44.83 | 78.78 | Seagate Momentus 7200.3 | ST9160411ASG | Serial Number: 5TG0K2CB Firmware Revision: DE17 | |
28.14 | 120.80 | Transcend 2.5" SATA-2 SSD | TS64GSSD25S-M | Serial Number: 002538030036 Firmware Revision: V090216 | |
70.98 | 125.97 | OCZ VERTEX-LE | Serial Number: f0409001b, Firmware Revision: 1.05 | ||
73.17 | 166.16 | apocalypse.dreamhost.com | Run on a shared hosting service. Drive specs unknown. Quite fast for a shared host. | ||
115.82 | 534.99 | Amazon EC2 | 184.72.242.0 Amazon EC2 West Coast server. Write speeds vary drastically. Average of 18 runs. Look at that read speed! | ||
131.15 | 269.65 | Amazon EC2 | 184.72.18.0 Amazon EC2 West Coast server. Write speeds vary drastically. Average of 9 runs. | ||
4.32 | 18.67 | Lexar Media 4GB | 05dc:a768 | ||
4.01 | 15.45 | Alcor Micro Corp. 2GB | 058f:6387 | This was from a free Jaguar car keyfob schwag. It was kind of crappy. | |
Do not mount with sync option
The first test run shows that write performance is over 12 times slower when the drive is mounted with the sync option versus the second test without the sync option. The other options have little effect. These tests were run on a USB flash drive.
first test
/dev/sdb1 on /media/usb0 type vfat (rw,noexec,nodev,sync,noatime,nodiratime) Running test three times... test 1: write: 0.34 MB/s, read: 18.67 MB/s test 2: write: 0.34 MB/s, read: 18.61 MB/s test 3: write: 0.34 MB/s, read: 18.29 MB/s
second test
/dev/sdb1 on /media/usb0 type vfat (rw) Running test three times... test 1: write: 4.32 MB/s, read: 18.51 MB/s test 2: write: 4.32 MB/s, read: 18.51 MB/s test 3: write: 4.31 MB/s, read: 18.46 MB/s
trivial benchmark tool
You can use `dd` to measure sustained drive throughput if you do it right. You want to bypass any cache and buffering in the I/O path. This is not hard, but it is uncommon enough that it can be difficult to find documentation on the correct options to use.
It is unclear if this will also bypass RAID controller cache. It almost certainly will not bypass the cache on the drive itself. You would need to activate additional option via `hdparm` if your drive offers them. I considered this a little too invasive and I wasn't sure if the options would be the same for every drive. Plus I figured that the drive controller cache is not really an optional component of the drive, so there is no reason to take it out of the equation; although, it does make it more difficult to interpret read-speed tests.
the most trivial drive benchmark tool
alias test-drive-speed='dd if=/dev/zero of=test_data.bin oflag=dsync conv=fdatasync bs=8388608 count=16 2>&1 | grep "bytes" | cut -f1,6 -d" " | awk '\''{printf ("write-speed: %7.2f MB/s, ", $1 / $2 / (1024*1024))}'\'' && dd if=test_data.bin iflag=direct conv=fdatasync of=/dev/null bs=8388608 count=16 2>&1 | grep "copied" | cut -f1,6 -d" " | awk '\''{printf ("read-speed: %7.2f MB/s\n", $1 / $2 / (1024*1024))}'\'''
slightly less trivial benchmark tool
#!/bin/bash # # test-drive-speed # # DESCRIPTION # # This performs a very simple drive speed test. It measures sustained # write and read speed to a 128 MB file. # # AUTHOR # # Noah Spurrier <noah@noah.org> # # LICENSE # # This license is OSI and FSF approved as GPL-compatible. # This license identical to the ISC License and is registered with and # approved by the Open Source Initiative. For more information vist: # http://opensource.org/licenses/isc-license.txt # # Copyright (c) 2010, Noah Spurrier <noah@noah.org> # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. # # VERSION # # Version 1 # echo "Uptime: $(uptime)" PWD=$(pwd) echo "The current directory is ${PWD}." CURRENT_DEV=$(df -hT $(pwd) \ | sed -n -e 's/^\(\/dev\/[a-zA-Z]\+[0-9]\+\).*/\1/p') if [ "${CURRENT_DEV}" = "" ]; then echo "Cannot find device associated with this directory." else echo "The current directory is stored on ${CURRENT_DEV}" if echo ${CURRENT_DEV} | grep -q /dev/md; then echo "This device is part of a sofware RAID." echo "The software RAID is configured as follows:" echo -en "\t" egrep 'md[0-9]+' /proc/mdstat CURRENT_DEV=$(egrep 'md[0-9]+' /proc/mdstat \ |sed -n -e 's/.*[[:space:]]\([a-z]*[0-9]*\)\[.\]$/\1/p') CURRENT_DEV="/dev/${CURRENT_DEV}" echo -n "The last drive in the array is " fi hdparm -I ${CURRENT_DEV} | sed -n -e '/^$/d' \ -e '0,/Standards:/p' | sed -n -e '$!p' fi echo "Running test three times..." for n in 1 2 3; do sync dd if=/dev/zero of=junk.bin oflag=dsync conv=fdatasync \ bs=8388608 count=16 2>&1|grep "copied"|cut -f1,6 -d" " \ |awk '{printf("write: %7.2f MB/s, ",$1/$2/(1024*1024))}' sync dd if=junk.bin iflag=direct conv=fdatasync of=/dev/null \ bs=8388608 count=16 2>&1|grep "copied"|cut -f1,6 -d" " \ |awk '{printf("read: %7.2f MB/s\n",$1/$2/(1024*1024))}' rm junk.bin done # vim:set sr et ts=4 sw=4 ft=sh: // See Vim, :help 'modeline'