Subject: RE: swap partition (was: uvm_faults)
To: =?iso-8859-1?Q?=22M=FCller=2C_Markus=22?= <Markus.Mueller@itworks-gmbh.de>
From: Claude Marinier <claude.marinier@dreo.dnd.ca>
List: netbsd-help
Date: 12/11/2001 09:48:34
Marc,

On Tue, 11 Dec 2001, "Müller, Markus" wrote:
> A friend of mine told me I should set the swap partition twice as big as
> the RAM, he always seemed to do this...

This is a 'rule of thumb' (interesting to speculate on the origin of this
expression). It works well in many cases.

Reality is more complex but the rule of thumb is safe. Let's try to look
at it with an example. Say my small server runs well with 256 MB of RAM
and 256 MB of swap but there is some swapping most of the time and a lot
of swapping once in a while. Note that since everything runs it must all
fit into memory plus swap, i.e. 512 MB is enough to handle the load. If I
want more speed, I could add 256 MB of RAM. This would completely (well,
there might be a bit left, gurus are invited to comment) eliminate swap-
ping because everything will fit into RAM (it still fits into 512 MB).

Swap is an extension of RAM that the system uses when it runs out of room
in RAM.

Note that if you put /tmp in swap space, it will compete for RAM with the
kernel and the processes. If the system runs out of RAM for all that, it
will stuff some of it up in swap space.

After this time of reflection, I see that the comment about /tmp in the
previous message was incorrect. Please ignore it.

Thanks.

-- 
Claude Marinier, Information Technology Group    claude.marinier@dreo.dnd.ca
Defence Research Establishment Ottawa (DREO)    (613) 998-4901  FAX 998-2675
3701 Carling Avenue, Ottawa, Ontario  K1A 0Z4         http://www.dreo.dnd.ca