[NTLUG:Discuss] RAID-1 server goes down after disk failure/SWAP -- musings..

Richard Geoffrion ntlug at rain4us.net
Tue Nov 21 12:14:38 CST 2006


Before asking the group 'why', I did my obligatory google search and I 
think I came up with a rather common sense answer!

The situation I have is that servers using software RAID-1 don't seem 
very stable when one of the hard drive fails.   When a hard drive does 
crash, the server locks up.  I think I have finally identified 'the 
smoking gun'[tm].  See, since the beginning of my using software raid-1 
in linux, I have created a separate swap partition on each drive.  My 
thoughts were that there would be a speed increase along with space 
savings if I split my swap partitions across two physical 
drives/controllers.  The problem with this setup (as described in the 
Software-Raid-HOWTO FAQ) is that if you swap to a drive then lose the 
drive---well.. you're goin down!

Reference:  
http://www.faqs.org/docs/Linux-HOWTO/Software-RAID-HOWTO.html#ss2.5

As I am currently rebuilding a few servers, I will need to do 
'something' about my swap partitions.  So... What is the current wisdom 
concerning setting up Software Raid-1?   What are the prevailing 
recommendations concerning swap files?   I've heard  everything from 
SWAP=2 times the system's RAM to SWAP= 1/2 the system's RAM.  It seems 
that swap will only use up to 2 gigabytes of a swap partition, so a 4gig 
swap partition on a 2gig of RAM server is....wasteful.  In today's 
multi-gig RAM climate, I can't seem to agree with the ever climbing SWAP 
space configurations.  Back in the days, 128Meg of swap on a 64Meg 
machine was plenty. Now that we have GIGs of RAM it would seem that the 
increase of all this RAM should obsolete the need for swap altogether?

And what about using a FILE for swap space instead of a partition??

And what about using TMPFS?   What *IF* you used tmpfs for your /tmp 
partition.  That would seem to reduces the amount of RAM available thus 
creating the need for more SWAP space??  Can one configure tmpfs to use 
swap space??   That would seem to be a cool way to have a totally 
temporary file system.

What practical applications and/or pitfalls am I missing?

-- 
Richard



More information about the Discuss mailing list