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

You absolutely do want to swap to disk. There are lots of non-file-backed cold pages that are pointless to keep in RAM forever. You could argue that these pages shouldn't exist, but they do, so why not shove them to a disk?
 help



I want instant access to my rarely used pages just as much as my frequently used pages. It's only pointless to keep in RAM if it's literally never used. If we knew how to identify those pages we could just avoid allocating them in the first place.

Your system is still swapping all your file-backed pages (e.g. .so files) unless you're mlockall()-ing everything. If you pin non-file-backed pages in RAM by running without a swap file, the system has a harder time keeping your frequently-accessed file-backed pages in RAM and can't do as good a job as optimizing your usage patterns.

All you're doing by running without swap is pessimizing yourself.


I think this problem is avoided with swap on zram by setting swappiness high enough (>100). Theoretically, 200 would be best, although I'm reluctant to set it to an extreme value because I don't know how well tested that is. I was previously running swappiness=160. I increased it to 180 and I'll see if I notice any difference.

wasting SSD writes for one. Especially if something leaks and it starts trashing



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

Search: