
On Tue, 23 Apr 2013, "Trent W. Buck" <trentbuck@gmail.com> wrote:
You can tweak OOM to make it avoid / never kill certain processes -- Ubuntu does this for sshd by default. But IME the OOM killer gets it right most of the time, whereas in the same pathological cases, with swap, the system became unusuable enough that all I could do was hold down the power button -- obviously much worse. YMMV &c.
http://doc.coker.com.au/projects/memlockd/ I wrote memlockd to alleviate some of those swap problems. The idea is that if you lock the files which are critical to system recovery (libc, /etc/passwd, sshd, kill, ps, and related things) into RAM then you have a better chance of recovering from such a problem before hitting a timeout (either system login timeout or human patience timeout). http://etbe.coker.com.au/2007/09/28/swap-space/ One of my more popular blog posts concerns the history of swap space and the way that the most common advice about swap size is bad. http://etbe.coker.com.au/2012/12/31/modern-swap-use/ In a more recent post I compared developments in RAM size vs developments in hard drive speed which makes it seem that swap is 400* less effective now than it was in 1988. I didn't consider the case of SSD which of course changes things. A single SSD would make swap maybe 5* less effective than it was in 1988 and a system with 5*SSD for swap (which isn't at all unreasonable given that an Intel SSD costs $100 vs $1000+ for a hard disk in 1988) would make swap as effective now as it was in 1988. -- My Main Blog http://etbe.coker.com.au/ My Documents Blog http://doc.coker.com.au/