Swap space

Robert Brockway robert-5LEc/6Zm6xCUd8a0hrldnti2O/JbrIOy at public.gmane.org
Mon Dec 14 01:24:12 UTC 2009


On Sun, 13 Dec 2009, William Muriithi wrote:

> Thanks Robert. Now that I have looked at it again, I see where I got
> the 2GB limit. You need to create multiple swap space to go above the
> 2GB.

Hi William.  Even that limit is gone.  Go and try to create a larger swap 
file on a modern Linux system - it will work.

> * The more RAM you have, the less likely the system will use it even
> under a heavy load. Some of the 16 GB systems have NEVER used swap for
> over two years according to cacti. Would there be something else using
> cacti to confirm whether this is general or load specific. Most of our
> system are either web servers (apache  and nginx) or database ( mysql)

Go and read up on the swapping algorithm and swappiness.  Linux will only 
swap on demand with swappiness set to 0.  With a higher value the system 
will swap opportunistically.

If your systems have never swapped then the memory spec is in excess of 
requirements.  Great.  More memory for disk cache and file buffers.

> * NONE of the system have ever used over 500 MB so far, irrespective
> of the load. Look like the 2 GB is actually a tad overkill

It is very important to avoid an out of memory condition (OOM), especially 
on a server.  Disk is cheap so it doesn't hurt to have a decent size swap 
even if you think it will never get used.  A small amount of kernel memory 
is consumed in managing the swap space.  It is hardly worth mentioning on 
modern systems though.

I cover thse topics in more detail here:

http://www.practicalsysadmin.com/wiki/index.php/Swap

Cheers,

Rob

-- 
I tried to change the world but they had a no-return policy
http://www.practicalsysadmin.com
--
The Toronto Linux Users Group.      Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists





More information about the Legacy mailing list