another newbie question

Tony Hammitt thammitt at kc.rr.com
Thu Oct 19 20:42:25 CDT 2000


Nope, didn't miswrite it.  The FreeBSD guys were the first to
discover  that software checksumming on a Pentium MMX or better was
many times faster than a raid card.  Check your boot logs, my laptop
checksums for raid (not like it uses it) at 1.5GB/sec.  Much faster
than the cards are capable of.  Since the kernel already knows how to
schedule the head positioning for the hard drives, and already has
the data in buffer cache, writing the data out over software raid is
very efficient.

Since the "software" raid is using optimized assembler MMX routines,
it's not really the same as if the routines were written in some
high-level language.  The bandwidth to the processor is about an
order of magnitude faster than the bandwidth to the PCI card, without
considering that the card may be sharing the bus with a video or
ethernet card.

Most cards only have about 32MB of memory and maybe a 100MHz
processor to generate the checksums.  Compared with a decent PC
running 256MB of 100MHz RAM and a couple of 600MHz processors (what's
that about $800 nowadays??), the raid card doesn't have any chance of
competing.

With software raid you can also use independant controllers, possibly
on different PCI buses, which is a bit difficult to do with one card.

It is still true that spending extra money on things that you use all
of the time like faster processors and extra RAM will result in a
larger perceived performance improvement than you would get with a
raid card that you only use when doing disk I/O.  That is independant
of whether you use raid at all or how you have implemented it. 
Linux's caches work pretty well and you won't be hitting the disk all
that often except to flush the data or get something new.

The reason that the hardware raid cards exist is that they have been
around for longer and have a lot of mindshare.  Software raid is
newer and has better kernel integration but doesn't completely
invalidate hardware raid.  Some of the raid cards can store updates
and flush them out to disk in the event of a system failure.  Others
allow you to plug in many more devices than usual.

In short, hardware raid is not always faster than software raid.  You
have to allow for changes in the state of the art.  I expect that
some company will come out with a raid card with hundreds of megs of
memory and multiple processors, but most of the time you won't be
able to use this capacity for anything else.  Once you add in the
fact that most hardware raid card drivers are somewhat experimental
(due to their manufacturers being naive) it's not surprising that
people have reported software raid implementations being several
times faster than hardware.

So, I think you misunderstood me.  I'm not talking about doing parity
within actual software, I'm talking about doing the calculations on
the processor's high-speed, specialized, designed that way on-
purpose, MMX unit using the much higher bandwidth main memory and
possibly using several independant controllers.  It really can be
much faster that way.

About RAID:  Does anyone ever use raid-4 (parity on one drive)?  I'm
a big fan of raid-1+0 (mirrored stripe set) which is really fast for
reading since each mirror can be reading different data.  "Raid-6" is
trying to become a specification; it uses redundant parity so you can
lose two drives and not lose any data.

Now we just need v2.4 to come out so we can use LVM and the
performance improvements in the I/O systems...  Then maybe someone
will do a believable benchmark test and get us some real numbers to
argue about.

Later,

Tony Hammitt

Jeffrey Watts wrote:
> 
> On Wed, 18 Oct 2000, Tony Hammitt wrote:
> 
> > Raid in Linux is best accomplished by using software instead of
> > hardware, especially on a newer x86 box.  Software raid is much faster
> > than hardware, as well as being cheaper.  You would get a lot more use
> > out of extra main memory and processor speed that you can buy instead
> > of an expensive raid card.
> 
> I'm assuming you miswrote this.  Hardware RAID is ALWAYS faster than
> software.  Period.  I suppose you could find a crappy RAID card that
> somehow screws up in one of the RAID types, but you can, with certainty,
> trust that 99.9% of the hardware RAID implementations out there are better
> than software.
> 
> Heck, the raison d'ete of hardware RAID controllers is that they are
> faster.  Who would buy one if hardware RAID was slower?
> 
> Now I agree with you if you are talking about a low-end server from a
> _practical_ perspective.  I would state that it would be better worth your
> money to buy extra CPU and RAM if you are doing simple mirroring (RAID 1)
> or striping (RAID 0).  On a low-end system the performance hit isn't that
> bad, and the money saved can be considerable.
> 
> But do NOT do RAID 4 or RAID 5 with software.  Skimp on the CPU and/or RAM
> if you must, but do RAID 4/5 with hardware only.  RAID 4/5 requires that
> for every write made, parity information must be generated.  Now, hardware
> implementations do this very fast and very efficient, but software
> implementations are just too slow and are an inefficient use of CPU
> cycles.
> 
> Also, most hardware RAID cards have either built-in cache or have sockets
> where you can add some.  This greatly improves performance, since the CPU
> sees the RAID volume as a single disk and can fire-and-forget its write to
> the RAID controller.  This again greatly improves performance, especially
> RAID 4/5 write performance.
> 
> Hope this helps,
> J.
> 
> o-----------------------------------o
> | Jeffrey Watts                     |
> | watts at jayhawks.net         o-------------------------------------------o
> | Systems Programmer         | "Is uniformity [of religion] attainable?  |
> | Network Systems Management |  Millions of innocent men, women, and     |
> | Sprint Communications      |  children, since the introduction of      |
> o----------------------------|  Christianity, have been burnt, tortured, |
>                              |  fined, imprisoned; yet we have not       |
>                              |  advanced one inch towards uniformity.    |
>                              |  -- Thomas Jefferson, "Notes on Virginia" |
>                              o-------------------------------------------o

-- 
Doubt is not a pleasant condition, but certainty is absurd. -- Voltaire




More information about the Kclug mailing list