From owner-freebsd-questions@FreeBSD.ORG Thu Mar 4 08:07:42 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BB71116A4CE for ; Thu, 4 Mar 2004 08:07:42 -0800 (PST) Received: from out005.verizon.net (out005pub.verizon.net [206.46.170.143]) by mx1.FreeBSD.org (Postfix) with ESMTP id 871D843D2F for ; Thu, 4 Mar 2004 08:07:42 -0800 (PST) (envelope-from cswiger@mac.com) Received: from mac.com ([68.161.120.219]) by out005.verizon.net (InterMail vM.5.01.06.06 201-253-122-130-106-20030910) with ESMTP id <20040304160741.YOVL2677.out005.verizon.net@mac.com> for ; Thu, 4 Mar 2004 10:07:41 -0600 Message-ID: <40475438.9020900@mac.com> Date: Thu, 04 Mar 2004 11:07:20 -0500 From: Chuck Swiger Organization: The Courts of Chaos User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6) Gecko/20040113 X-Accept-Language: en-us, en MIME-Version: 1.0 Cc: freebsd-questions@freebsd.org References: <000601c4016d$cdb571e0$0a06a8c0@rekon> <200403040154.14373.danny@ricin.com> In-Reply-To: <200403040154.14373.danny@ricin.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Authentication-Info: Submitted using SMTP AUTH at out005.verizon.net from [68.161.120.219] at Thu, 4 Mar 2004 10:07:41 -0600 Subject: Re: RAID1 vs RAID5 [ was Re: 1 processor vs. 2] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Mar 2004 16:07:43 -0000 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