My software RAID-0 reads slower than it writes?

Discussion in 'macOS' started by funkahdafi, Mar 23, 2009.

  1. funkahdafi macrumors 6502

    Joined:
    Mar 16, 2009
    Location:
    Planet Earth, Old World
    #1
    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
     
  2. funkahdafi thread starter macrumors 6502

    Joined:
    Mar 16, 2009
    Location:
    Planet Earth, Old World
  3. Guiyon macrumors 6502a

    Joined:
    Mar 19, 2008
    Location:
    North Shore, MA
    #3
    Have you double checked your commands? The write test is using 1MB blocks while the read test looks like it is using 1KB blocks.
     
  4. funkahdafi thread starter macrumors 6502

    Joined:
    Mar 16, 2009
    Location:
    Planet Earth, Old World
    #4
    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.
     
  5. ElectricSheep macrumors 6502

    ElectricSheep

    Joined:
    Feb 18, 2004
    Location:
    Wilmington, DE
    #5
    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.
     
  6. funkahdafi thread starter macrumors 6502

    Joined:
    Mar 16, 2009
    Location:
    Planet Earth, Old World
    #6
    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.
     

Share This Page