5 ms·
If your failover doesn't take extreme slowdowns into account, you've still screwed up. It's more complicated than just turning off swap. Even without swap, wh
by Dylan16807 11y ago
If your failover doesn't take extreme slowdowns into account, you've still screwed up.
It's more complicated than just turning off swap. Even without swap, when you run extremely low on memory the page cache will be squeezed to nothing and you'll thrash. And I don't think there's a way to set a minimum page cache on Linux.
So in other words, I would not rely on the OOM killer ever kicking in.
In a situation with more memory use over time a small swap can act as a canary, letting you know you're nearing a performance drop, while a swapless server could suddenly hit a molasses wall without dying.
- aidenn0 11y agoThrashing the page cache is typically much less horrible than swap thrashing, so swap off is still an improvement. If you want a canary, why not just directly monitor the page cache size?
- Dylan16807 11y agoI suppose it depends how big your binaries are, but once those are getting culled from memory things are not pretty. Keep in mind that if your swap is not huge, it will very often fill will cold data and you won't have swap thrashing despite running out of memory. Good point about measuring the page cache directly.
- aidenn0 11y agoAh yes. We can agree that both small swap and no swap are superior to the "2x RAM" nonsense that still pops up as a recommendation though.