Mikkel L. Ellertson wrote:
Steve Lindemann wrote:
In days gone by the rule of thumb for *nix was swap should be 1/2 the
size of RAM. Hadn't heard about that rule changing, but then I'm not on
the bleeding edge these days.... though on my servers with 16GB of RAM
it felt like a bit much setting swap to 8GB (but I did it anyway 8^)
I though the old rule was to for swap to be 2x RAM. This was because
a core dump would use 1x RAM size of swap. This is no longer the
case. Now days, if you are doing suspend to disk, you need slightly
more then the amount of RAM in swap space, plus what you need for
normal operation. If you are not going to suspend to disk, then the
swap space needed depends on the system. If you have enough RAM, you
do not need any swap space. For example, this system has 1M of RAM,
and it normally uses more then 5M of swap space. There are no simple
rules for swap size any more.
The thing to remember is that swap space is used for when you do not
have enough physical memory. It is sometime used for keeping
program that are sleeping handy for reloading, but still freeing up
RAM for other uses. (A program may get swapped out when more RAM is
needed, and left swapped out even though there is RAM being used for
buffers...)
Mikkel
hhhmmm.... now that you mention it, I do remember way *way* back using
2x RAM for swap. But we were lucky to a 1MB of RAM back then, 256K and
512K was pretty common in the big servers. Somewhere along the way, as
RAM size increased, I picked up the 1/2 RAM rule of thumb (probably when
we passed the 1MB mark) and it's worked ok for me for some while now so
I pretty much forgot about the 2x rule of thumb. I wish I could blame
old age, but I've pretty much always had a rotten memory (probably could
use some swap space of my own 8^)
--
Steve Lindemann __
Network Administrator //\\ ASCII Ribbon Campaign
Marmot Library Network, Inc. \\// against HTML/RTF email,
url: http://www.marmot.org //\\ vCards & M$ attachments
email: mailto:steve@xxxxxxxxxx
voice: +1.970.242.3331 ext 16
fax: +1.970.245.7854