jarry@gmx.net wrote:
If a disk fails,
your system would likely crash (due to the swap device), but would
reboot in a degraded mode (no swap, slow performance, etc).
      
You could avoid that by not using RAID for swap. Instead, use four
separate swap partitions, one on each drive. As long as they all have
the same priority, the kernel will share swap duties between them
equally.
    
 
If you make more swap partitions on more physical drives with the same
priority, it is the same as swap on raid0: system strips swap across
drives. And if some drive crashes and swap partition on that drive has
been used, very probably system crashes too. But then reboots at least
with remaining swap partitions...
  

Yes, although there's a posibility of an 'endless crash/reboot' scenereo here, if the errors are 'soft' (e.g. not drive just vanishing).  For instance, a few bad sectors develop on one of your swap partitions, the kernel can't read them, and panic/reboots.  The system comes back up, the same swaps are used, and it happens again, over and over until you edit the bad partition out of the fstab.

In a redundant RAID situation, I'm presuming that a bad sector or two would result in the RAID driver detaching the bad drive, and chugging along in degraded mode, where if this happened in a distrubuted swap situation, it's already 'too late', since the sectors are lost and the kernel would probably panic.

There's no real benefit to using RAID for swap, unless you are
limited on RAM and use swap a lot, when RAID0 may help.
    

There is some benefit, if you use raid1 for swap. In such a case
even drive failure does not cause system crash, because swap space
is mirrored too. But raid1 slightly degrades swap performance...
  

This is exactly why I'm doing RAID1 on swap.  If one drive goes poof, my system stays up.  Based on what this server is going to do, it should rarely use much swap, so swap performance isn't a priority for me.  Plus, as you say, I believe the performance hit on swap writes (reads should actually be faster) should wind up being only a bit slower than if you were swapping to a single drive.

- Jim

-- 
+---------------------------------------------------------------------------+
|         Jim Burwell - Sr. Systems/Network/Security Engineer, JSBC         |
+---------------------------------------------------------------------------+
| "I never let my schooling get in the way of my education." - Mark Twain   |
| "UNIX was never designed to keep people from doing stupid things, because |
|  that policy would also keep them from doing clever things." - Doug Gwyn  |
| "Cool is only three letters away from Fool" - Mike Muir, Suicyco          |
| "..Government in its best state is but a necessary evil; in its worst     |
|  state an intolerable one.." - Thomas Paine, "Common Sense" (1776)        |
+---------------------------------------------------------------------------+
|   Email:  jimb@jsbc.cc                              ICQ UIN:  1695089     |
+---------------------------------------------------------------------------+
|  Reply problems ?  Turn off the "sign" function in email prog.  Blame MS. |
+---------------------------------------------------------------------------+