Here's something that's been bugging me for a while now...[snip]
I have several Linux servers that have been given enough RAM that they
rarely ever use any swap space. For example, here's the typical output
of uptime and free:
root@veronica$ uptime; free
03:55:33 up 225 days, 17:34, 0 users, load average: 0.09, 0.13, 0.19
total used free shared buffers cached
Mem: 2076136 1931288 144848 0 150220 964108
-/+ buffers/cache: 816960 1259176
Swap: 524280 156 524124
As you can see, it's been up for the better part of a year and is only
using 156k of swap. The swappiness is set to the default of 60, so
there's no reason why the server *shouldn't* be using swap -- it just
never does.
On some of my older servers with a little less RAM and the 2.4 kernel
I'll occasionally see the swap go up into the double digits, but even
this is relatively infrequent. On all the machines with a 2.6 kernel
and 2GB+ RAM, I've almost never seen more than 1-2MB swap used.
The consensus these days seems to be that since hard drives are so big
now, go with a gig or more of swap even if you have plenty of RAM.
However, the way I'm seeing it is this: What's the point of having a
gig of swap if it only gets used during the worst possible time?