Linked by David Adams on Thu 20th Nov 2008 04:19 UTC
General Unix Linux and other Unix-like operating systems use the term "swap" to describe both the act of moving memory pages between RAM and disk. It is common to use a whole partition of a hard disk for swapping. However, with the 2.6 Linux kernel, swap files are just as fast as swap partitions. Now, many admins (both Windows and Linux/UNIX) follow an old rule of thumb that your swap partition should be twice the size of your main system RAM. Let us say I’ve 32GB RAM, should I set swap space to 64 GB? Is 64 GB of swap space really required? How big should your Linux / UNIX swap space be?
Thread beginning with comment 337855
To read all comments associated with this story, please click here.
Common sense required
by -APT- on Thu 20th Nov 2008 11:03 UTC
-APT-
Member since:
2007-03-20

You need to figure out the workload for the machine you're using and set the amount of swap accordingly.

I run quite a lot of virtualised servers on machines with fairly limited RAM, varying on how tight I need to squeeze the memory on these servers I tend to set swap to 1-2 times the amount of memory. I obviously hope that the machine won't use it too much, but for these virtual servers the performance doesn't matter too much.

Now for real servers where performance is important I wouldn't consider allocating so much. I'd keep an eye on the machine to ensure that all the services have limits set so they don't start going into swap. Maybe just add 1GB swap on these servers just as a safety measure.

These days RAM is cheap enough to put excessive amounts into machines.

Edited 2008-11-20 11:03 UTC

Reply Score: 1