Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

funkahdafi

Suspended
Original poster
Mar 16, 2009
377
112
Planet Earth
Hi,

I am using two disks in a RAID-0 array, configured via Disk Util. Works pretty good. Now I did some basic "benchmarking" just to find out it writes way faster than it reads. Shouldn't it be the other way around? Here are some results:

Code:
reptilehouse:~ sascha$ time dd if=/dev/zero of=/Volumes/HD1/testfile bs=1024k count=16384
16384+0 records in
16384+0 records out
17179869184 bytes transferred in 87.676360 secs (195946424 bytes/sec)

real    1m27.774s
user    0m0.065s
sys     0m22.029s


reptilehouse:~ sascha$ time dd of=/dev/null if=/Volumes/HD1/testfile bs=1024
16777216+0 records in
16777216+0 records out
17179869184 bytes transferred in 99.680770 secs (172348881 bytes/sec)

real    1m39.696s
user    0m22.333s
sys     1m9.159s

So that's roughly 200 MB/sec. when writing vs. around 170 MB/sec. when reading. That's kind of odd. This is reproducable by the way and happens all the time.

Any thoughts on this?

Thanks
 

Guiyon

macrumors 6502a
Mar 19, 2008
771
4
Cambridge, MA
Have you double checked your commands? The write test is using 1MB blocks while the read test looks like it is using 1KB blocks.
 

funkahdafi

Suspended
Original poster
Mar 16, 2009
377
112
Planet Earth
Have you double checked your commands? The write test is using 1MB blocks while the read test looks like it is using 1KB blocks.

Good point. You are right. I just tried again by using bs=1024k when reading, but I am still getting the same results. Reading is still a lot slower. Last time I tried write=195MB/sec. vs. read=157MB/sec.
 

ElectricSheep

macrumors 6502
Feb 18, 2004
498
4
Wilmington, DE
Its likely that what you are seeing here are the effects of write-back caching. Blocks you think are being written to disk may be cached in RAM before a flush operation. This can artificially inflate write benchmarks with tools like dd.
 

funkahdafi

Suspended
Original poster
Mar 16, 2009
377
112
Planet Earth
Its likely that what you are seeing here are the effects of write-back caching. Blocks you think are being written to disk may be cached in RAM before a flush operation. This can artificially inflate write benchmarks with tools like dd.

Makes sense.

However, I chose a filesize twice as large as my physical memory. And my hard drives have 1 throughput of 100 MB/sec (single). So I would expect to see 200 MB/sec. in raid 0 when reading.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.