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

I don't disagree with swap being helpful in some (maybe most?) cases.

But there are cases where it clearly does more harm then good. I had a postgresql datbase server with a lot of load on it. The server had loads of ram, more than what postgresql had been configured to use plus the actual database size on disk. Even so linux one day decided to swap out parts of the database's memory, i assume since that was very rarely used and it was decided that something else would be more useful to have in memory. When the time came for queries that used that part of the database, they had a huge latency compared to what was expected.

Maybe i'm misremembering and maybe there was some way of preventing that from happen while still having a swap enabled on the server..



vm.swappiness [1] could be what you're looking for. I find the default value of 60 leaves my desktop more prone to swapping out than I would like (but then firefox consuming >15gb of ram leaves it little choice).

[1] http://en.wikipedia.org/wiki/Swappiness




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

Search: