3 ms·
Depends on your usage patterns. On 8GB I gave it (ZRAM) between 512MB to 768MB RAM, and later on just using whatever values for the relevant sysctls AntiX was u
by LargoLasskhyfv 1y ago
Depends on your usage patterns. On 8GB I gave it (ZRAM) between 512MB to 768MB RAM, and later on just using whatever values for the relevant sysctls AntiX was using(or their scripts created dynamically during setup/startup) at the time. It isn't just vm.swappiness, there are others, and they changed, or got removed, and replaced by others, over the years. And all of them sort of interwoven, influencing each other via what's happening in vm-subsystem. Can have bad feedback loops if you do it wrong, and be counterproductive. So you have to experiment, and measure with different settings, for what you're running.
Where measure can be anything from htop/atop over https://github.com/cdown/psi-notify https://github.com/cdown/psi-notify , to https://github.com/noiseonwires/memory-pressure https://github.com/noiseonwires/memory-pressure and so on.
To understand what these sysctls are about, how they are related to each other, and to ZRAM, I'd recommend reading, or at least skimming https://chrisdown.name/2018/01/02/in-defence-of-swap.html https://chrisdown.name/2018/01/02/in-defence-of-swap.html , https://chrisdown.name/2019/07/18/linux-memory-management-at-scale.html https://chrisdown.name/2019/07/18/linux-memory-management-at... , https://linuxblog.io/linux-performance-almost-always-add-swap-space https://linuxblog.io/linux-performance-almost-always-add-swa... , https://linuxblog.io/linux-performance-almost-always-add-swap-part2-zram https://linuxblog.io/linux-performance-almost-always-add-swa... , https://linuxblog.io/linux-performance-no-swap-space https://linuxblog.io/linux-performance-no-swap-space , https://linuxblog.io/running-out-of-ram-linux-add-zram https://linuxblog.io/running-out-of-ram-linux-add-zram , https://github.com/ValveSoftware/SteamOS/issues/899 https://github.com/ValveSoftware/SteamOS/issues/899 , https://lonesysadmin.net/2013/12/22/better-linux-disk-caching-performance-vm-dirty_ratio https://lonesysadmin.net/2013/12/22/better-linux-disk-cachin... , https://github.com/CachyOS/CachyOS-Settings/pull/19 https://github.com/CachyOS/CachyOS-Settings/pull/19 , https://github.com/CachyOS/CachyOS-Settings https://github.com/CachyOS/CachyOS-Settings , https://docs.kernel.org/admin-guide/sysctl/vm.html https://docs.kernel.org/admin-guide/sysctl/vm.html , https://docs.kernel.org/accounting/psi.html https://docs.kernel.org/accounting/psi.html , https://facebookmicrosites.github.io/psi/docs/overview https://facebookmicrosites.github.io/psi/docs/overview , https://unixism.net/2019/08/linux-pressure-stall-information-psi-by-example https://unixism.net/2019/08/linux-pressure-stall-information...
even if it seems redundant, OFC skim and discard anything you already know(But I can't know that).
The following not to use them, but for their POVs/concepts regarding the same problem:
https://github.com/facebookincubator/oomd https://github.com/facebookincubator/oomd , https://github.com/rfjakob/earlyoom https://github.com/rfjakob/earlyoom , https://github.com/hakavlad/nohang https://github.com/hakavlad/nohang
These, to maybe take inspiration from, to adjust dynamically:
https://www.linuxbash.sh/post/tune-vmswappiness-in-a-script-to-optimize-memory-for-a-specific-workload https://www.linuxbash.sh/post/tune-vmswappiness-in-a-script-... , https://github.com/lululoid/LMKD-PSI-Activator https://github.com/lululoid/LMKD-PSI-Activator (Yes, Android, I know, but still...)
Then there is the whole thing about eBPF, which opens up much more screws to turn dynamically according to demand, according to whichever policies.
https://www.brendangregg.com/ebpf.html https://www.brendangregg.com/ebpf.html / https://deepwiki.com/oracle/bpftune/1-overview https://deepwiki.com/oracle/bpftune/1-overview
Have fun :)