Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

One trick people in a similar situation on linux use is to make a small ram disk and then assign that as the swap. A little absurd but prevents the bad behavior.


It is indeed absurd, when swapping can be avoided entirely by setting kernel swappiness to 0:

sysctl -w vm.swappiness=0

to make permanent, set vm.swappiness=0 in /etc/sysctl.conf

Though for a desktop machine, disabling swap probably won't help improve performance


That's true, but this was a special circumstance where disabling swap was creating very bad system behavior.


pre 3.5 it doesn't actually disable swap, it will only use it when it's about to OOM.

post 3.5 it does actually hard-disable, but setting swappiness to 1 gives the same behaviour as swappiness=0 in < 3.5


That's good to know, thanks.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: