Starting from 21x versions systemd
only applies kernel parameters changes made through /etc/sysctl.d/*.conf
and /usr/lib/sysctl.d/*.conf
files. It ignores changes made through /etc/sysctl.conf
file.
I prefer to set swappiness to 10 and cache-pressure to 30, and it works:
┌──[just]@[alexsop]:~$
└─> dt && cat /etc/sysctl.d/90-swappy.conf
Current datetime:
2019-10-28 11:32:45
#--just added
vm.swappiness=10
vm.vfs_cache_pressure=30
#--
┌──[just]@[alexsop]:~$
└─> dt && sudo cat /proc/sys/vm/swappiness
Current datetime:
2019-10-28 11:32:54
10
┌──[just]@[alexsop]:~$
└─> dt && sudo cat /proc/sys/vm/vfs_cache_pressure
Current datetime:
2019-10-28 11:32:58
30
┌──[just]@[alexsop]:~$
└─>
Reboot is needed for changes to take effect.