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 337922
To view parent comment, click here.
To read all comments associated with this story, please click here.
sbergman27
Member since:
2005-07-24

virtual memory is one of the few things usually implemented very well on most oses. trust your os builder, he's most likely smarter than you are.

Indeed. On the XDMCP server I mentioned in another post, we once tried changing the /proc/sys/vm/swappiness value from the default of 60 to the oft-recommended 10. This causes the kernel to try to avoid swapping out pages until it really has to. It was a huge performance "lose". Back to 60 we went. I know from other experience that going to the other extreme, say, swappiness=90 yields pretty good results during the work day. But when everyone goes to log out at exactly 5PM... mama mia! The swap in load is killer as all those pages that are only needed at log in and log out have to be swapped back in. It often pays to trust the defaults.

Edit: Another nice thing about defaults is that they are the most well tested config. Remember that data corruption bug in ext3 several years ago that only affected people who ran with data=journal, presumably in order to be "extra safe"?

Edited 2008-11-20 22:24 UTC

Reply Parent Score: 2