changes in /etc/sysctl.conf are ignored on reboot

Asked by Corneil du Plessis

My Ubuntu 12.04 x64 on Dell XPS 15 with 8GB of RAM has been really sluggish.

After some searching I came across post about swappiness. I noticed that swappiness on my system was reported as 0 which means swapping should only start when memory is all used and yet is was actually acting much the same as when swappiness is 60.

I set swappiness to 10 using:

echo 10 > /proc/sys/vm/swappiness
and update /etc/sysctl.conf with:

vm.swappiness = 10
After rebooting I notice that swappiness is reported as 0 again with same sluggish performance. I ran echo 10 > /proc/sys/vm/swappiness and the performance improved remarkably.

I rebooted again and check swappiness, it was reported as 0 again. I executed sudo sysctl -p and could see the values from sysctl.conf take effect.

It seems that the values from /etc/sysctl.conf is ignored on boot.

I have a notebook with Ubuntu 12.04 32 bit and I also applied the same configuration. On the notebook the changes do take effect as expected and remain after a reboot.

Has anyone come across this kind of problem?

Question information

English Edit question
Ubuntu procps Edit question
No assignee Edit question
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :


echo "vm.swappiness = 10" | sudo tee -a /etc/sysctl.conf > /dev/null
sudo sysctl -p

Should do it

Revision history for this message
Corneil du Plessis (corneil-wbs) said :

The problem is not that vm.swappiness = 10 does not remain in /etc/sysctl.conf the problem is that the value is ignored when the system boots.

The value is always 0 after boot.

The second problem is that swappiness = 0 behaves more like swappiness = 100 than swappiness = 1.

Revision history for this message
Launchpad Janitor (janitor) said :

This question was expired because it remained in the 'Open' state without activity for the last 15 days.

Revision history for this message
Jason Spashett (jspashett) said :

There are many config files in /etc/sysctl.conf

The problem is that the values seems to get played into sysctl -w

If you look the values have a space seperator between name and value, which sysctl does not accept,
therefore as a workaround for your own settings make sure there is no space.



instead of

vm.swappiness = 100

Something needs to be done about the existing configuration files, this is actually a bug.

Revision history for this message
actionparsnip (andrew-woodhead666) said :

There are config LINES, not files. /etc/sysctl.conf is a text file so cannot contain files.

swappiness of 100 isn't a great idea ;)