4 ms·
> performance, security, wearout reasons If memory pressure is low, and the swap is used to page out rarely / never used pages in favour of more disk cache, th
by gnode 7y ago
> performance, security, wearout reasons
If memory pressure is low, and the swap is used to page out rarely / never used pages in favour of more disk cache, then there is a performance gain to be had, and wear should be minimal.
You can encrypt swap with a randomly generated key to aid security.
Ideally memory compression and disk swap would be used together; there's a gain to be had by shrinking lesser used pages, but no sense in taking up any space in RAM for pages showing no sign of life.
- zzzcpan 7y agoMore vfs cache for swap space is not a trade off here, but rather a mostly incorrect oversimplification. The value of more cache is very non linear, it depends on the workload and usually only matters when nearly all of the disk I/O is already exhausted, the exact situation you want to prevent by using more of the same disk I/O for swap. Essentially trading more cache for abrupt performance degradation in terms of latency and responsiveness. I mean, sure, if you can't use zram, say you are on a system that's a bit behind on performance features, like freebsd, very light swappiness might be ok, might free up some of very unused memory and just not be aggressive enough to swap something that causes latency, responsiveness problems, although this is not certain. With memory compression you can swap and compress much more of it more aggressively and be certain that no abrupt performance degradation can happen. It feels like having more ram that's gradually affecting tail latency the more you use it.
- Dylan16807 7y agoZram is nice when you're barely using it, but every time I've seen it get low on memory it degrades quite abruptly, much worse than ssd swap.