[sf-lug] Ubuntu 7.10 Video Problem

Rick Moen rick at linuxmafia.com
Thu Dec 20 15:03:58 PST 2007

Quoting Blake Haggerty (Blake.Haggerty at Sapphire.com):

> Arn't Sawp partitions supposed to be double your ram??

That's indeed the traditional rule of thumb for Unixes.  (Some OS
vendors say 1.5 times RAM.) The actual amount of swap that's likely to
be useful is situation-dependent.

The fact that no single multiplier can really address all situations
should be obvious from considering boundary cases:  

(1) Consider a situation of a 16 MB RAM 486 Linux server with running
twelve major userspace processes, each with about a 10MB footprint.
(For the sake of discussion, let's assume each process is active for a
calendar month and then can be swapped out to VM the other 11 months of
the year, so the swap-out/swap-in at the beginning of the month isn't a

The rule of thumb would dictate 32MB swap, but that's absurd, because
without at least around 150MB swap, the system is going to run out of VM
and start killing processes -- and because disk space is so cheap that
why on earth would you skimp on a mere 100MB or so of swap?

(2) Consider a Opteron machine with 64GB RAM, that you happen to be
severely underusing as a business workstation.  Conventional wisdom
would dictate a 128GB swap, but that would be absurd because in all
likelihood you'd make actual use of only maybe a few _megabytes_ of

If you want to observe how much swap your own computing situation
actually uses, get acquainted with /usr/bin/vmstat.  Once you have a
handle on actual usage, one could reasonably argue that -- next rebuild
-- you would take that amount, add some amount more to give you some
breathing room, and then use that figure for the amount of swap.

Be careful not to confuse actual memory usage with disk cache.  The
Linux kernel _always_ uses uncommitted memory to speed up disk access,
which is A Good Thing and in no way indicates shortage of RAM (but
rather indicates intelligent -use- of RAM).

More information about the sf-lug mailing list