RAID 1 Is Not Slow


Recommended Posts

We have all heard the classic advice that RAID 0 gives better performance while RAID 1 is for redundancy.  That is not a wrong statement, but what most people do not realize is that RAID 1 also performs better than a single drive.  In fact, in many real-world applications, RAID 1 performs almost as well as RAID 0.

 

Imagine a byte of data on a computer, the amount of data used to store a single character (ascii that is, Unicode requires more space).  A single file is made up of thousands of bytes, but to keep things simple, I am only going to talk about one byte at a time.  8 sequential binary bits make up each byte, looking something like 011100110.  In this conversation we do not care what the bits are, only that they exist, so instead I will number them, 12345678.  On a computer with a single drive, a byte would simply look like 12345678.  Physically the bits do not really sit in order like that, they are stripped cross the different platters of the drive, but because a drive's arm must move in unison across all platters together, we can logically think of it as a large single platter were the bits do sit in order.

 

RAID 0 stripes bits between two drives, so a byte would look like:

Disk 1:  1357

Disk 2:  2468

It allows twice the information to be stored, and with both drives working together, reads and writes take half the time.

 

On RAID 1 there are two drives with an identical layout, so a byte looks like this:

Disk 1:  12345678

Disk 2:  12345678

Reads and writes take the same amount of time they would on a single drive.  However, in the case of reads, all data is on both drives, so only 1 drive is needed.  With 2 drives available, 2 independent reads can be performed at the same time; like a duel-core hard drive!  That is called multiplexing.  In order to keep the two drives consistence, writes require both drives to write the same data at the same time.

 

So far RAID 0 is the clear winner when writing data with RAID 1 offering no advantage.  RAID 1 has the advantage of running two reads at the same time but cannot match RAID 0's ability to rapidly read data.  Would you prefer a duel-core 1.5 GHz processor, or a single core 3.0 GHz?  Anyone with a brain would say the single 3.0 is better; it can do two tasks in the same amount of time, or a single task twice as fast.

 

The problem for storage is that spindle drives create a lot of downtime between I/Os caused by seek time.  The average seek consumes the majority of time required complete an I/O.  RAID 1's ability to optimize seeks between 2 drives can be a big advantage on small reads.  Keep in mind RAID 0 requires both drives to perform every seek because both sets of data must be combined to reconstruct the information.

 

In most real-world PC applications, reads are more common than writes, and they are typically small to medium in size, not huge sequential reads nicely laying in order on the drive.  Even computer games, where you might assume load-time is a direct result of sequential read speed, the game is multi-threaded, to take advantage of multi-core processors.  One thread may be loading background images while another thread loads character models.  The entire game library is never loaded at once, so seeks are being performed as the game skips around the disk picking what it needs.

 

RAID 1 offers better performance for the very small reads while RAID 0 starts to pull ahead on medium sized reads (typically loading more than 1 track, or 5-10 MB, at a time.)  In many cases, the two configurations end up performing about the same on typical loads.  The one common home task where RAID 0 really shines is working with non-linear video or audio editors which tend to create a lot of large sequential reads and writes.

 

So why do benchmarks always show RAID 0 so much faster?  Benchmarks typically show a sequential read and sequential write test, which we expect the RAID 0 to do well at.  They typically also have some kind of random read/write test which the RAID 0 configuration may not look as good, but is still ahead of RAID 1.  Those random tests tend to be 50% reads and 50% writes, which the writes tend to punish RAID 1 more than a real application would.  Even in those benchmarks, the RAID 1 configuration should be close to RAID 0 and better than a single drive in random read/writes.

 

It is also important to point out that RAID 0 isn

Link to comment
Share on other sites

Nice RAID post.. I have two Corsair 512GB drives in RAID0.. been that like for years.. I had one of the drives fail, and it was just firmware issue.. But, I lost all of my OS drive.. Which is nothing important, but had my entire STEAM folder on it.. 600GB isn't fun downloading over 25MB.. lol Since the drives are down, maybe I can get two more and run a RAID 10.

Link to comment
Share on other sites

Yeah, RAID 10 is truly the best of both worlds if you have 4 drives.  You can also run RAID 5 with 3 drives, but RAID 5 suffers from poor write performance if that is important to you.  That is why for servers, databases typically run on RAID 1 or 10 and file servers on RAID 5.  A file server doesn't really need fast write speeds because the server can cache writes to RAM until the write is complete and the user doesn't notice the difference.

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.