2

This has been asked a number of times before. However, at the risk of being flagged a duplicate I thought I would ask again, as I have not seen answers specific to Ubuntu 19.10, and none of these recommended answers works for me.

In short: Setting vm.swappiness = 10 directly in /etc/sysctl.conf, or creating a file /etc/sysctl.d/60-my-swappiness.conf with the content vm.swappiness = 10, does not change the swappiness on boot; it remains at the default value of 60:

$ cat /proc/sys/vm/swappiness
60

Running sysctl -p with sudo permissions changes it for the given session, but on reboot it resets back to the default.

$ sudo sysctl -p
[sudo] password for user: 
vm.swappiness = 10
...
$ cat /proc/sys/vm/swappiness
10

How do you change the swappiness so that it persists between reboots in Ubuntu 19.10?

1 Answer 1

0

Suggest you make a sysctl.d(5) configuration file so the configuration is set at boot time, with contents similar to:

/etc/sysctl.d/99-swappiness.conf
vm.swappiness=10
5
  • I have already done this with no success. Does it matter what the file is called? I chose /etc/sysctl.d/60-my-swappiness.conf but I was under the impression it was irrelevant Nov 18, 2019 at 21:01
  • also, I believe the line must have spaces between the variable and the value (see here) Nov 18, 2019 at 21:02
  • Yes, the name is important.
    – K7AAY
    Nov 18, 2019 at 21:13
  • doesn't work for me I'm afraid Nov 19, 2019 at 15:04
  • Drat. Anyone else?
    – K7AAY
    Nov 19, 2019 at 16:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .