Max swap size?

Corey Edwards tensai at zmonkey.org
Thu May 29 00:10:32 MDT 2008


On Wed, 2008-05-28 at 20:36 -0600, Stephen Ward wrote:
> Today I was poking around on a CentOS amd64 machine that keeps
> randomly crashing.  I am not the sysadmin for this machine; he is on
> vacation.  Anyway, I noticed something that seemed unusual to me.
> This machine has 1 GB of RAM, and a grand total of 8 GB of swap
> consisting of two 4 GB partitions, each on a separate drive.  These
> two drives also happen to be in a RAID-1 mdadm device.
> 
> Does a 4 GB swap partition seem excessively large to anyone?  I read
> the mkswap man page and found the following regarding swap
> limitations:

I'll echo the sentiments expressed so far and add a few of my own
thoughts. In these days of excessive amounts of RAM it does seem a
little odd to have swap partitions at all. Certainly it is possible to
build a system without it. But if you run out of RAM completely, the out
of memory (OOM) killer takes over and processes start being nuked.
That's never a good thing. Have some swap around can save a system.

If you're using hibernation then I would recommend going double RAM.
Otherwise unless you've got a really RAM starved machine, I wouldn't
create more swap than you have physical RAM and I don't think I would
create more than 1-2GB total.

As far as RAID goes, it's not the worst thing in the world to have swap
on a hardware RAID volume, but it's less optimal. You'll get more
storage if you leave that one as a raw disk. That may not be a real
option so don't sweat it with hardware RAID. With software RAID it's
really a no-brainer: don't ever put swap on a software RAID volume.

Corey

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://plug.org/pipermail/plug/attachments/20080529/93e261b3/attachment.bin 


More information about the PLUG mailing list