3 ms·
As long as you have only spinning rust for swap I disable it. After reading that article some time ago I tried to add a little swap to my shared general purpose
by nisa 5y ago
As long as you have only spinning rust for swap I disable it. After reading that article some time ago I tried to add a little swap to my shared general purpose machines (running quite a mixed workload that sometimes tends to explode e.g. matrix synapse is famous for that) and the box still grinded into an unresponsive state even with just 4GB swap. Maybe I did something wrong - But I'd rather tolerate an OOM kill (mostly contained by cgroups/container/lxd) and a few seconds (or minutes) of unresponsiveness instead of a complete lockup that results in a hard reset. Not sure if it's better on SSD. I've enabled zswap for 1/8 of memory on the Desktop and this seems to improve things but as long as you have spinning rust or other slow storage my experience is that the machine will die a slow death as long as swap is active.
There is some interesting stuff in newer kernels - like multigenerational mru [1] and that le9 patchset [2]
Am I missing something? If you have full control over the memory usage this might be useful for the mentioned usecase but for a general purpose machine this doesn't work?
1: https://patchwork.kernel.org/project/linux-mm/cover/20210818063107.2696454-1-yuzhao@google.com/ https://patchwork.kernel.org/project/linux-mm/cover/20210818...
2: https://github.com/hakavlad/le9-patch https://github.com/hakavlad/le9-patch
- p_l 5y agoInteresting. I used to have considerable swap as the last line of defence against certain memory hog cases, back with not-very-fast spinning rust (Thinkpad R61i). I rarely had heavy thrashing, and worst case I had the choice of killing Firefox (4.0 back then!) or making fresh cup of tea - but usually it meant that things would spill over then get back into good condition. Funnily enough, I mostly suffer from thrashing today, on Mac, especially with chrome. And it's mostly with compressed memory, though overzealous nature of swapping in macos doesn't help.