Tuesday, April 8, 2008

Software RAID really is faster

I have run my personal computer on a RAID mirror for years now. I learned the primary reason for RAID on the day, more than 10 years ago, when I started my current job and discovered that my new employer's file server had been running in recovery mode -- for months -- on their RAID-5 array. I had never actually seen a RAID array much less had to recover one. Ah, yes, those were exciting days: "Must.. Fix.. Server, or.. Lose.. New.. Job!"

I've also gone through dozens of hard drives, most of which were malfunctioning by the time I trashed them (and yes, I now securely wipe them beforehand). So it makes great sense to use duplicate drives to avoid a catastrophic failure of one.

One of the other reasons is supposed to be that it's faster. More drives should equal more potential throughput. But in practice it's rarely the case. Most tests I've seen of RAID-5, for instance, show it to be much slower than the simpler forms of RAID, e.g. RAID-4 which uses more drives but avoids the need for any CRC calculations (or whatever RAID-5 is spending so much time doing).

Now, finally, I feel confident that my RAID really is faster. I did a very simple test on my test machine which is setup almost identically to my 'production' machine. The computer is a P4 with 1GB running Ubuntu 7.04 on a pair of identical IDE drives configured as a software mirror. I disabled the login prompt (in System > Administration > Login Window > Security, Enable Automatic Login) and then also set the 'Startup' to immediately load about a dozen apps (in System > Preferences > Sessions, New).

Running normally (with both drives) the test config took about 1:30 to boot and finish loading everything.

I then unplugged one of the drives, let the system figure-out that the array needed to run 'degraded', and retested. It now took over 2:00 to do the same process.

So the mirrored drives appeared to be 25% faster! Of course, a better test would be to reinstall without any RAID partitions, i.e., to eliminate the possibility that the degraded array was the culprit. But then I'd also have to try and recreate the exact same set of installed apps etc, and I'm not that interested in disproving my newfound satisfaction!

No comments: