Date: Thu, 04 Mar 2004 11:07:20 -0500 From: Chuck Swiger <cswiger@mac.com> Cc: freebsd-questions@freebsd.org Subject: Re: RAID1 vs RAID5 [ was Re: 1 processor vs. 2] Message-ID: <40475438.9020900@mac.com> In-Reply-To: <200403040154.14373.danny@ricin.com> References: <000601c4016d$cdb571e0$0a06a8c0@rekon> <200403040154.14373.danny@ricin.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Danny Pansters wrote: > So statistically and theoreticaly RAID1 compares to no RAID at all as 2x read > speed, 1x write speed (it needs to be written twice but through two heads on > two drives seperately and assume they react and move at the same speed). That's about right, but you should be aware of the fact that you are only considering a single transaction. When you think about a stream of I/O requests, either round-robin or geometric division of read access can perform better depending on whether you are moving lots or data (few big requests) or doing many small reads and being bound by seek times. Because the heads may be in different places do to distribution of reads, the heads don't end up writing data out at the exact same time; allowing write to be asyncronous rather than requiring both drives to complete a write operation can speed things up, particularly if geometric distribution of reads is being used. > Take a RAID5 with 5 drives that would in terms of data resiliance compare with > a RAID1 of 3 drives at best (right?). No. A three-disk RAID-1 arry can retain data even if two drives fail. The RAID-5 array will lose data if two drives fail. In more complicated cases (RAID-10 and RAID-50), RAID-1 has significantly greater reliability than RAID-5. Also, RAID-5 performance degrades horribly if a drive is down, whereas RAID-1 does fine... > Change the above numbers for a RAID1 to > 3 drives and you have a 3x read and a 1x write speed. With the hypothetical > RAID5 as above we have 3x read and 1x write speed for data plus 2x read and > 1x write for parity info which will usually be smaller in size. Let's assume > they're of comparative sizes, to make things simple, then we have 5/2x reads > and 1x writes to compare. For your analysis to be valid, you need to consider the size of I/O requests and the stripe or interleave size of the RAID arrays. For example: A five-disk RAID-5 array has to read 4 sectors and write five sectors if you change one byte. 9 I/O ops compared with either 2 or 3, depending on whether one has a two-disk or three-disk RAID-1 mirror. In other words, RAID-1 small writes are often a factor of four times faster than RAID-5 writes for data much smaller than stripe size. Likewise, your analysis of RAID-5 read performance neglects to consider the fact that data is only available on one drive, whereas will be available on two (or more) drives for RAID-1. For small reads, seek performance is critical and RAID-1 performance is close to n times that of a bare drive, where n is number of drives in array, and can sometimes even be slightly higher than n. RAID-5 performance can at best be (n - 1) and is usually closer half that because the I/O distribution potential of mirroring means you can't choose to utilize a drive that's free. Perhaps a better way of putting it is that RAID-1 can decrease response latency by handling reads in parallel, whereas a RAID-5 array cannot because a particular set of data is only available from one place. -- -Chuck
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?40475438.9020900>