Originally posted by: Overmind
Can you detail a bit ?
I'm interested in this.
Why would a software RAID be faster than a hardware one ?
There are several reasons:
1. A real hardware RAID like one on a several-hundred-dollars-plus 3ware, Areca, or Intel RAID controller has a little bitty ARM I/O processor in the 300-800 MHz range computing the XOR calculations needed for running a RAID 3, 4, 5, 6, or any nested RAID level that includes those RAID types (50, 53, etc.) Software-based RAID in an anywhere-near-modern system has a couple-GHz, SIMD-supporting multicore x86 processor available to do the calculations. You do the math as to which one is faster. I'll give you a hint- my two and a half-year-old Athlon 64 X2 4200+ can XOR 7077 MB/sec worth of data on a single core under md, according to what my dmesg says.
2. The available bandwidth to the CPU is much higher than bandwidth to any onboard I/O processor and latency is probably lower as well. This helps to speed XOR calculations in cases of distributed parity RAID.
3. Probably the biggest reason for extra speed is that you can use disks attached anywhere in an md array, whereas you have to have the disks all on one card for hardware-based RAID is used. This means that you can span an md RAID across multiple PCIe disk controllers, massively increasing the amount of aggregate bandwidth available to the array as a whole.
4. Motherboard-based RAID is software RAID as well as there is no controller chip on board to do I/O calculations. The calculations are handled by the CPU just as they are in md raid- the OS just sees the array as bootup rather than the individual drives at first and then assembling the array later on in the boot sequence.
This is possible only if some super-caching system is used in sfotware-mode.
Nothing like that exists specifically for Linux RAID. The OS caches some things read from disk into RAM, but it does that regardless if there is a RAID or not. However, there are DDR or DDR2 memory modules used as caches on high-end hardware RAID cards in write-back mode which can speed up small writes and cached reads. I think you may be able to use that memory in either md or hardware RAID though.
What about stability issues and RAID management ?
I have run md RAID 5 for years and it has been rock-solid. The only way I can think that you could foul things up in md but not hardware RAID is if you have an overclocked CPU and a bus lock keeping the hardware RAID card at stock speed. But if you run any parity-containing RAID level, you are likely not going to be overclocking so this is moot.
Management of RAID under md is MUCH better than with a hardware card. In fact, RAID management is the biggest advantage to md over hardware RAID. You are not tied to a single specific RAID controller card. If your HW RAID card dies, you need to get an identical or at least similar one otherwise you cannot read the array. With md, it will work as long as you have enough ports to connect the HDDs to. You can also easily add drives to a RAID 5 (perhaps 4 or 6 as well, I have not tried) while the array is active as well.