[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: What is the point of RAID?



On Fri, 07 Nov 2008, Mike Bird wrote:
>> systems have RAID / and RAID /boot.  Some have RAID swap, although
>> there are performance tradeoffs to be considered for RAID swap.

> On Fri Nov  7 18:50 , Henrique de Moraes Holschuh  sent:
> Well, I hope you ARE aware that the box will lock up hard or panic if
> anything happens to the device hosting the swap AND it needs to swap in or
> out.

> Better to swap to file inside the RAID array, or to not have a swap
> partition at all, if you are not going to protect it.

Very sound advice, and to expand on this, please check this link:
  http://tldp.org/HOWTO/Software-RAID-HOWTO-2.html#ss2.3

<snip>
There's no reason to use RAID for swap performance reasons. The kernel itself can stripe swapping on several devices, if you just give them the same priority in the /etc/fstab file.

A nice /etc/fstab looks like:

/dev/sda2       swap           swap    defaults,pri=1   0 0
/dev/sdb2       swap           swap    defaults,pri=1   0 0
/dev/sdc2       swap           swap    defaults,pri=1   0 0
/dev/sdd2       swap           swap    defaults,pri=1   0 0
/dev/sde2       swap           swap    defaults,pri=1   0 0
/dev/sdf2        swap           swap    defaults,pri=1   0 0
/dev/sdg2       swap           swap    defaults,pri=1   0 0

This setup lets the machine swap in parallel on seven SCSI devices. No need for RAID, since this has been a kernel feature for a long time.

Another reason to use RAID for swap is high availability. If you set up a system to boot on eg. a RAID-1 device, the system should be able to survive a disk crash. But if the system has been swapping on the now faulty device, you will for sure be going down. Swapping on a RAID-1 device would solve this problem.

There has been a lot of discussion about whether swap was stable on RAID devices. This is a continuing debate, because it depends highly on other aspects of the kernel as well. As of this writing, it seems that swapping on RAID should be perfectly stable, you should however stress-test the system yourself until you are satisfied with the stability.

You can set up RAID in a swap file on a file system on your RAID device, or you can set up a RAID device as a swap partition, as you see fit. As usual, the RAID device is just a block device.
<snip>


Disregard what is says about "SCSI", yet this information is still valid.
It pertains to all modern day drives (PATA, SATA, SCSI, etc.).

However, I'm not quite sure I agree with the last paragraph in the 
<snip> I've provided.  It may lead to the same type of failure  Henrique
described.  Please correct me if I'm wrong.

- Ken Teague



Reply to: