0

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 value 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? How can I fix it?

Zanna
  • 72,312

2 Answers2

1

Try this:

Start a terminal emulator and run

cd /etc/sysctl.d/
echo "vm.swappiness = 10" | sudo tee 60-memory-management.conf
sudo chmod 644 60-memory-management.conf

Reboot and check if the new values are in use with:

cat /proc/sys/vm/swappiness`
Zanna
  • 72,312
0

I just bung the following in my /etc/rc.local

sysctl -w vm.swappiness=1 #Discourage swapping.

Basically, you can run this command: sudo sysctl -w vm.swappiness=1 at any time to change the swappiness.. cat /proc/sys/vm/swappiness gives 1 after this.

Grizly
  • 435