Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 15 Mar 1998 13:44:00 -0500
From:      Cory Kempf <ckempf@enigami.com>
To:        Raul Zighelboim <rzig@gulfsouth.verio.net>, "'scsi@freebsd.org'" <scsi@FreeBSD.ORG>
Subject:   Re: to raid or not to raid
Message-ID:  <v04003a24b131be90dab6@[208.140.182.45]>
In-Reply-To: <A03CD00C69B1D01195AB00A024ECEB167110D9@kaori.communique.net>

index | next in thread | previous in thread | raw e-mail

Oh Cool, one I can answer....

At 10:53 -0500 98.03.15, Raul Zighelboim wrote:
>Could anyone point me to documentation on the pros and cons of raid
>5/raid 0 in a non-pro language ?
>Also, any pro/cons off 'raid 0 over raid 5' ?

OK, there are three major flavours of RAID, 0, 1, and 5.

(assuming I haven't scrambled the numbers again...) These levels correspond
to Striping, Mirroring, and sort of a combo of the two.

Start with a basic disk.  You do a read (writes work similarly).  The
system asks the disk for blocks 100-400. The disk mechanism moves the
heads, and when the data is under the head reads into its internal buffer,
then sends it out.  This maybe happens at 8MB / second, on a fairly modern
drive.

In the old days, the bus was tied to that disk while it was looking for the
data.  Then came disconnect: the computer instead says get the data, bug me
when you have it.  It still takes the same amount of time, but the data can
be "burst" to the host much faster, say 20 MB / sec on Ultra SCSI.

And this is where RAID comes in.  With Striping, we take a pair of 4 GB
disks (for example), and pretend they are one 8GB disk.  We ask drive A for
the first 64 blocls, and while it is looking for that, we disconnect and
and ask drive B for the second 64 blocks.  Drive A comes back and says it
is done, here is the data, and we ask it for the third 64 blocks.  Drive B
comes back and... The point is, the data moves at about double the speed as
with a single disk.  Due to overhead, it isn't twice as fast, but it is
faster.

The down side is that if one disk dies, you lose all the data on both
drives.  Thus your MTBF is cut in half.

Mirroring, IMO, is a waste.  The idea is that if one drive has a HW
failure, well, the data is on two drives, no big deal.  IME, hardware
failures are much less common than soft failures, and with a soft failure,
both drives are hosed with the same bad data.  Typical MTBF (mean time
between failures) nowdays is around 800,000 hours... or about 91 years.  At
least according to the manufacturor.  (uh huh, right.  And how did they
come up with that number?)

Raid 5 takes 3 disks (or more, and sort of stripes them and sort of mirrors
them.  With three 4 GB disks, you have 8 GB storage.  Lets say you were
writing the following (binary) data:

   1100 1010

Drive A would get 1100, drive B would get 1010, and Drive C would get 0110,
or the first XOR the second.  Now, lets say drive B has a HW failure.  If
we XOR the data on Drive A with that on drive C, we get: 1010.  In other
words, we can recover from any one drive failure.  The downside is that you
need to do the XORs for each write (writes are ~20% of I/O ops) and have to
write it out to disk, and you pay for three drives but only get two.
Generally, you need hardware support to make it work though.

In short, while RAID 5 is more expensive, it gives you most of the benefits
of RAID 0 and 1, without the expense of RAID 1 or the risk of RAID 0.

Multiple busses are used if there is not enough bandwidth on a single bus.
FWIW, UW SCSI has bandwidth of around 40 MB /s.  Fiber SCSI is much faster.
The fastest disks out there (Seagate Cheetahs this week) only put out
around 16 MB / s IME.


+C


--
Thinking of purchasing RAM from the Chip Merchant?  Please read this first:
<http://www.enigami.com/~ckempf/chipmerchant.html>;

Cory Kempf                  Macintosh / Unix Consulting & Software Development
ckempf@enigami.com          <http://www.enigami.com/~ckempf/>;



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-scsi" in the body of the message


help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?v04003a24b131be90dab6>