Ubuntu Netbook, a simple tweak to make it work faster

Ubuntu-Lucid-Logo-Orange

Most of the times it happens that Ubuntu Netbook becomes agonizingly slow. Checking the RAM usage shows that only half of RAM is used (and quite obviously half is still free not being utilized) while SWAP memory usage is above 50%. This confuses many (including me) because SWAP memory is a lot slower than RAM and since RAM is available why Ubuntu even bother using SWAP.

What is SWAP?

Before moving to why this happens I will like to tell a few things about SWAP. SWAP is a portion of your hard disk dedicated to work as RAM. RAM is a fast piece of hardware and works more efficiently and so it is preferred that most of the process run in it. But, since RAM is very expensive, Linux makes use of SWAP that actually fakes to be a RAM and is used if RAM memory is not sufficient enough to hold the running processes.

Why Ubuntu uses SWAP when RAM is available

The problem here is RAM is available and Ubuntu is still using SWAP memory. This is due to the fact that the default value for swappiness is 60. Now what is swappiness? Swappiness is a parameter that controls the likelihood of the kernel to move the processes from RAM to the SWAP (a sort of virtuall ram). This value can be altered from 0 to 100. The higher the value the higher will be the chance of processes being moved to SWAP area and vice versa. So, here we are simple going to lower the swappiness value. A swappiness value of 10 is recommended but the default value is 60

How do I decrease swappiness value

To change the swappiness value just follow the following instructions. :

To see the current swappiness vaule type this in Terminal (to open terminal goto Application > Accessories > Terminal) and type the following command

cat /proc/sys/vm/swappiness

To temporarily change the swappiness value (lost on reboot) type:

sudo sysctl vm.swappiness=10

To change the swappiness value permanently type the following to open sysctl.conf in editor:

gksudo gedit /etc/sysctl.conf

Now search for vm.swappiness and change it to vm.swappiness=10. If vm.swappiness is not found then add following at the end of the file:

vm.swappiness=10

Save and reboot your system, you will notice the increase in performance.

Source:

Iqrash Awan

Some say he’s half man half fish, others say he’s more of a seventy/thirty split. Either way he’s a fishy bastard.

2 comments:

  1. Great tip! I've just rebooted and even the startup phase seems to be faster (is it possible?). A question: any drawbacks?

    ReplyDelete
  2. The increase in performance is amazing, this is one great tip

    ReplyDelete