Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Benchmark your SSD or hard disk speed Apps
You can benchmark the speed of your SSD or hard disk using a few simple Terminal commands. To test write speed:
time dd if=/dev/zero bs=1024k of=tstfile count=1024
In the output, you should look for something that looks like "bytes transferred in 16.546732 secs (519131791 bytes/sec)." Copy and paste the bytes/sec speed into Google to convert to MB/s (e.g. Google search for "519131791 bytes/s in megabytes/s").

To test read speed:
 dd if=tstfile bs=1024k of=/dev/null count=1024
[kirkmc adds: While we're on the subject, here's an easy way to test data throughput from one disk to another. Open Activity Monitor (in /Applications/Utilities), click on the Disk Activity tab at the bottom of the window, then look at the Data read/sec and Data written/sec numbers. Copy a large file from one disk to another to see how fast it can go. FWIW, my new Thunderbolt drive has throughput of about 100 MB/sec.

You can run the above commands while watching the information in Activity Monitor, and skip making the conversions. This shows that I have a peak read speed of 137 MB/sec, and a peak write speed of 151 MB/sec (an SSD in a Mac mini). The commands above will give you average speeds, whereas Activity Monitor shows the speed in real time, as well as peak speeds. See the comments below for what may be a better approach.]
    •    
  • Currently 4.50 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (4 votes cast)
 
[21,277 views]  

Benchmark your SSD or hard disk speed | 15 comments | Create New Account
Click here to return to the 'Benchmark your SSD or hard disk speed' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Benchmark your SSD or hard disk speed
Authored by: fracai on Jul 11, '12 07:44:16AM
That second command isn't going to measure the read speed of your disk at all. It's reading from /dev/zero and writing to /dev/null; both are virtual devices. The first command already wrote out a temporary file, so just read from that:
dd if=tstfile bs=1024k of=/dev/null count=1024
For a better view of disk performance, these commands should be run with varying block sizes (bs=) and the results plotted. This is left as an exercise for the reader.
---
i am jack's amusing sig file


[ Reply to This | # ]
Benchmark your SSD or hard disk speed
Authored by: kirkmc on Jul 11, '12 07:59:51AM

Thanks. The submission had the same command twice, and as it was anonymous, I couldn't contact the poster. I did some Googling and found that second command. It seemed to work for me, but I've changed it in the hint.

---
Mac OS X Hints editor - Macworld senior contributor
http://www.mcelhearn.com



[ Reply to This | # ]
Benchmark your SSD or hard disk speed
Authored by: bfu.me on Jul 11, '12 07:52:12AM

The read speed test is flawed as written. Using /dev/zero as dd's input and output file doesn't hit the disk at all and will return ridiculous speeds like 15-20 GB/sec. The proper way to do the read test is to be to dd the tstfile created by the write benchmark into /dev/null (but only after clearing the RAM cache by using the "purge" command).

This one-liner will test the write speed, clear the cache, properly test the read speed, and then remove tstfile to reclaim disk space:

dd if=/dev/zero bs=1024k of=tstfile count=1024 && purge && dd if=tstfile bs=1024k of=/dev/null count=1024 && rm tstfile



[ Reply to This | # ]
Benchmark your SSD or hard disk speed
Authored by: ericswanson on Jul 11, '12 09:15:21PM

Here's what I get using this method (and dividing by 1048576 to get Mb/sec):

Internal laptop hd (7200 rpm, sata): Write=42.99 Mb/sec, Read=38.09 Mb/sec
External G-Raid (esata): Write=134.76 Mb/sec, Read=192.32 Mb/sec
External Seagate hd (laptop drive, USB-2): Write=33.59 Mb/sec, Read=36.38 Mb/sec
External G-Raid (Firewire 800): Write=60.79 Mb/sec, Read=66.17 Mb/sec
Encrypted sparsebundle image on external G-Raid above (esata): Write=68.66 Mb/sec, Read=81.33 Mb/sec



[ Reply to This | # ]
Benchmark your SSD or hard disk speed
Authored by: EldRick on Jul 11, '12 10:39:01AM

That's not really very fast for Thunderbolt.

I bought a Factory Refurb LaCie Little Big Drive for $229 (LaCie.com), removed the drives and the fan, and replaced the drives with a pair of SSDs. Using RAID0, I get around 450MB/s read and 360MB/s write speeds with every test I've tried. It's much faster than the internal SSD in my 2011 iMac.



[ Reply to This | # ]
Benchmark your SSD or hard disk speed
Authored by: kirkmc on Jul 11, '12 11:23:09AM
Yes, the WD My Book is a bit slower, but it has no fan, which is a big plus. I wonder, though, if I should be getting higher speeds... Oh, BTW, I'm not using RAID 0. I'm using mine as two 2 TB disks. That cuts the speed in half.
---
Mac OS X Hints editor - Macworld senior contributor
http://www.mcelhearn.com
Edited on Jul 11, '12 11:24:12AM by kirkmc


[ Reply to This | # ]
Benchmark your SSD or hard disk speed
Authored by: chucky23 on Jul 11, '12 10:41:57AM

The freeware Xbench's Disk Test offers a nice method for getting a few different kinds of disk benchmarks.



[ Reply to This | # ]
Benchmark your SSD or hard disk speed
Authored by: wallybear on Jul 11, '12 04:08:32PM
To obtain speed expressed in MB/sec, just append the following string to each one of the commands:
2>&1 | grep sec | awk '{print "scale = 2 ; "$(NF-1048576) "}' | bc
i.e:
time dd if=/dev/zero bs=1024k of=tstfile count=1024 2>&1 | grep sec | awk '{print "scale = 2 ; "$(NF-1048576) "}' | bc
and
dd if=tstfile bs=1024k of=/dev/null count=1024  2>&1 | grep sec | awk '{print "scale = 2 ; "$(NF-1048576) "}' | bc
No need to google around.
Edited on Jul 11, '12 04:12:16PM by wallybear


[ Reply to This | # ]
Benchmark your SSD or hard disk speed
Authored by: cagg on Jul 11, '12 08:22:16PM

Also keep in mind it's only as fast as your system's slowest bottleneck. I realized this myself when I recently upgraded my internal HDD to SSD. Obviously I didn't do proper research. I got a top of the line model and was expecting super fast speeds around 460MB/s on SATA-III, only to realize that my 2008 MBP only has SATA-I so I get about 120 MB/s.
Probably still faster than HDD, but I never did measure the speed before I upgraded.



[ Reply to This | # ]
Benchmark your SSD or hard disk speed
Authored by: MikeIT on Jul 12, '12 08:14:21AM

You wouldn't save a great deal of money going sata-I or II ssd and this way you are future proof if you'll get a new mac.



[ Reply to This | # ]
Benchmark your SSD or hard disk speed
Authored by: cagg on Aug 03, '12 02:28:38PM

That thought had occurred to me too. However if I was going to upgrade my Macbook Pro the new one would probably already have SSD and wouldn't be user-replaceable (like in the new Retina Display version)



[ Reply to This | # ]
Benchmark your SSD or hard disk speed
Authored by: wjv on Jul 12, '12 06:30:55AM
…or you can just use a disk benchmarking tool like bonnie, which is available to be installed from MacPorts.

[ Reply to This | # ]
Benchmark your SSD or hard disk speed
Authored by: RogParish on Jul 13, '12 09:01:23AM

When I tried:

time dd if=/dev/zero bs=1024k of=tstfile count=1024 2>&1 | grep sec | awk '{print "scale = 2 ; "$(NF-1048576) "}' | bc

I got:

awk: non-terminated string }cale = 2 ... at source line 1
context is
>>> <<<
awk: giving up
source line number 2

Mac OS X Lion 10.7.4

---
Roger
Lovettsville, VA



[ Reply to This | # ]
Benchmark your SSD or hard disk speed
Authored by: bobsc on Jul 13, '12 10:06:59AM

That awk line has an extra quote, it appears.
Any way, I found that this works:

time dd if=/dev/zero bs=1024k of=tstfile count=1024 2>&1 | grep sec | awk '{print $1 / 1024 / 1024 / $5, "MB/sec" }'

You don't need bc at all, awk can do the arithmetic. I am dividing the total bytes by the total seconds and by

By the way, my standard internal drive in my 27" iMac (2.8GHz, a couple of years old) did the writing at 91 MB/sec.

---
bobsc



[ Reply to This | # ]
Benchmark your SSD or hard disk speed
Authored by: bobsc on Jul 13, '12 11:50:35AM

Even better, leave out grep also. Awk can do its own pattern matching:


time dd if=/dev/zero bs=1024k of=tstfile count=1024 2>&1 | awk '/sec/ {print $1 / $5 / 1048576, "MB/sec" }'

---
bobsc



[ Reply to This | # ]