How to change vm_swappiness with systemd?

All guides wich i found tell about changing swap with systemctl, but manjaro uses systemd and there is no details in archwiki or google wich i found about changing swappines with systemd systems

Any clue how to change swappines on systemd-controles system (exclude changing default 60 in kernel code)

For temporarily change (to 10) you can use:

sysctl -w vm.swappiness=10

To make this change permanent you need create file:

/etc/sysctl.d/99-swappiness.conf
----------------------------------------
vm.swappiness=10

Here you can find more details.

:question:

systemctl is, to quote, “Control the systemd system and service manager”, as in very much a part of systemd.

Whereas sysctl is to control kernel parameters.

But the example above of a ‘directory.d’ is a function of systemd … .d folders can contain files that function as drop-in configurations or addendums.

Though I dont think I have seen swappiness managed through systemd/systemctl … except maybe as dynamically set through a service or timer.

Google “manjaro swappiness” - the first result gives a solution.

sudo tee /etc/sysctl.d/swappiness.conf <<< vm.swappiness=10

and this to check it is working after restart

inxi -Pa

Documentation for /proc/sys/vm/ - swappiness — The Linux Kernel documentation

Does number in filename matters ?
I tryed same thing in past but used 75 instead of 99, and it ain’t worked

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.