Lee H. Marzke on 11 Apr 2013 10:53:25 -0700


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

Re: [PLUG] RAID for swap?


I've run my laptop on Ubuntu encrypted LVM for years.  This
puts /boot in one partition and /, /swap, and /home in an LVM
"pv"  on a LUKS encrypted volume.

Not RAID, but I've had no issues with this setup, even after
hard power downs etc.    Even running VMworkstation inside
works well,  and running VM guests survive a host suspend.

In any case, I do recommend using LVM on top of RAID as it give you much
more flexiblity in working with the volumes.



Lee

----- Original Message -----
> From: "Rich Freeman" <r-plug@thefreemanclan.net>
> To: "Philadelphia Linux User's Group Discussion List" <plug@lists.phillylinux.org>
> Sent: Thursday, 11 April, 2013 1:28:54 PM
> Subject: Re: [PLUG] RAID for swap?
> 
> On Thu, Apr 11, 2013 at 12:44 PM, christopher barry
> <cbarry@rjmetrics.com> wrote:
> > Use a separate SSD for swap if you *really* think you'll be needing
> > to
> > regularly use swap. Otherwise, install enough memory for your
> > needs.
> > Avoid having to use swap in the first place.
> >
> 
> Cost of RAM: $8/GB.  Cost of HD: $0.10/GB.  Sure, I'd rather have the
> former than the latter, but it isn't always the most cost-effective
> solution for rare peaks in usage.
> 
> I run my swap on top of LVM+raid5, and I'm not sure I would recommend
> this.  On the one hand it is more disaster-resistant.  On the other
> hand I tend to get panics when my system heavily swaps, and I'm not
> sure why.  Only once I managed to capture the error message - it
> looked like some kind of filesystem sync issue (maybe ext4 is
> crashing
> when the drives are heavily utilized).  Usually I just find my server
> unresponsive with the monitor refusing to wake up (sysrq-sub will
> reboot it, though I doubt the s/u does anything).  Usually in that
> state the drive light just flickers about once a second or so.  Might
> be hardware though - I have a much better case now and I haven't seen
> it happen yet (though I haven't done any RAM-hungry tasks yet).
> 
> For me the main drivers for using swap are so that I don't invoke the
> oom-killer when I get some odd spike in usage, to help mitigate apps
> that tend to leak RAM (the wasted RAM just gets swapped out and never
> read, and I don't lose cache), and for cases where my tmpfs fills up
> (usually while building something big like openoffice or chromium -
> especially if I'm building a few things in parallel).  On Gentoo
> building with tmpfs is a MASSIVE performance improvement, but a few
> packages consume a fair bit of space during builds so it can't always
> fit into RAM.  It will never perform worse that building from disk -
> the only difference between swapping tmpfs and ext3 is that the
> former
> only ever writes something to disk if RAM is in demand, and the
> latter
> always writes everything to disk within 30 seconds even if it will
> never be needed again.
> 
> If you do put swap on raid I wouldn't do it on top of a file - every
> layer hurts performance.  I'd keep it simple.  Keep in mind that if a
> consumer drive fails on a consumer motherboard there is a chance that
> your whole system or the other drives will hang due to hardware
> glitches - consumer motherboards don't do as good a job isolating
> individual drives as a server board does.
> 
> Rich
> ___________________________________________________________________________
> Philadelphia Linux Users Group         --
>        http://www.phillylinux.org
> Announcements -
> http://lists.phillylinux.org/mailman/listinfo/plug-announce
> General Discussion  --
>   http://lists.phillylinux.org/mailman/listinfo/plug
> 

-- 
"Between subtle shading and the absence of light lies the nuance of iqlusion..." - Kryptos 

Lee Marzke, lee@marzke.net http://marzke.net/lee/ 
___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug