1

Alright, so I've been having trouble with the default value of swappniess (60) making life a living hell (which is probably another problem that needs to be sorted out, but currently cannot be until swappiness gets out of the way). I try setting it down to 10 and even 0 with:

sudo sysctl vm.swappiness=0

but as soon as I turn the system back on, swappiness is right back at 60 and my system is defaulting to using swap for everything until I die of old age at the iowait hangup (like I said, I know swappiness isn't the chief culprit, but I can't operate with it in the room). So, how do I solve it? I've heard that I can supposedly add in "vm.swappiness = 0" to sysctl.conf, but I'm really not sure how to add it in in order to make it both stay and not have the computer blow up. (like, is there a specific place in there I need? Do I tack it onto the end? Do I preface it with a #?)

So, basically, I don't need the classic and easy to find answer of "how to lower swappiness," I need the annoyingly necessary answer of "how to keep it lowered."

Running Ubuntu 15.10, in case that helps.

1 Answers1

1

This is a duplicate of How do I configure swappiness? .

Short answer: add the line

vm.swappiness = 0 

to the file /etc/sysctl.conf and the change will persist after rebooting.

Since it's a system file, you will need to open your editor with superuser privileges.

gksudo gedit /etc/sysctl.conf

should work if you're running regular Ubuntu, or you could use

sudo nano /etc/sysctl.conf

to edit the file in a terminal on any Ubuntu variant. (If you use nano, CTRL+O saves the file and CTRL+X exits the editor when you're done.)

Add it exactly as written, to the end of the file, on its own line (press ENTER a couple times to create a new line, if necessary), save the file, and exit. Do not add a #. The system will not blow up.

Please let me know if this helps or if you have additional questions or clarifications.

  • I'd like to point out that due to the difference of parameters of the answer, I do not think this is exactly a duplicate. While the previous question asked for the line to input, this question asks more how it is to be input. – Phoxxent May 03 '16 at 03:39
  • Alright, I've implemented per your specification and it appears to have stuck. Thank you very much, you have been extremely helpful. – Phoxxent May 03 '16 at 04:00
  • @Phoxxent You're welcome! I'm glad I could help. –  May 03 '16 at 04:03