I followed a link from a /. article and found this bit on tuning swappiness
. Apparently in 2.6.x, you can dump values to /proc/sys/vm/swappiness to set how "swappy" your system is.
This is interesting to me, because I am rather annoyed when:
2.) Open up some apps
3.) Leave overnight
4.) updatedb (for locate) runs, hammering the fs and causing the file cache to swap out all my apps to disk
5.) Come back in the morning
6.) Box is super slow the first time I access each app because it has to get it from swap.
If the file cache wouldn't be so aggressive in causing things to be swapped out, this wouldn't happen.
Can anyone recommend any good values? Looks like the default is 60. Andrew Morton says he uses 100 for his desktop machines (really aggressive swap, wtf?) but other folks (random google) seem to be using about 10-30. I think I'm going to chop it to 30 for a week on my laptop (only 256MB RAM) and see what happens.UPDATE
: This doesn't seem to make much of a difference. As of 2.6.5, the kernel seems to adjust this value over time.