[Gllug] Linux - big not small

Doug Winter doug at pigeonhold.com
Fri Aug 5 07:21:24 UTC 2005


Richard Jones wrote:
> The whole "swap must be twice as large as physical RAM" thing is
> based on an ancient version of Unix which required that all physical
> RAM was backed by swap first, before it could use further swap for
> actually swapping.  On this ancient system, it was a requirement to
> have swap = RAM, and having swap = 2 * RAM would effectively double
> available memory.  This has never applied to Linux, although that
> hasn't stopped people from parroting the rule frequently ever since.

Deciding on the correct amount of swap space needs a good understanding 
of what the machine is going to be doing, and can be really quite tricky 
I think.

I've seen development servers with swap=10xRAM, because they had to run 
a load of java appservers for developers.  Nothing wrong with that - 
it's what the machine was for.  Obviously it was really slow, since it 
was constantly swapping, but that didn't matter.

Desktops might as well have quite a bit of swap, in case you find 
yourself wanting to run any java apps :)  Since desktop machines 
routinely come with a large enough hard disk to run a small nation you 
might as well throw a lot of swap in, even if it's never used.

For production systems you almost certainly want to tune them to run 
without swapping if possible.  As soon as you start swapping performance 
goes down the drain, so you are generally better to reduce memory use 
than add swap.  It's worth having some swap, because often it takes time 
to get tuning right, and also you can never entirely predict what 
hairbrained stuff someone is going to want to run - but there's no need 
for loads.  Also production systems often benefit from the spare disk 
space, since disks are significantly more expensive for them (because 
RAID and requiring faster disks).

All that said, more swap is better than less if you don't know what 
you're going to need, and 2xRAM is as good a rule of thumb as any I guess.

Cheers,

Doug.

-- 
http://adju.st/
XML is not the answer.  It is not even the question.
6973E2CF: 2C95 66AD 1596 37D2 41FC 609F 76C0 A4EC 6973 E2CF
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list