27 February 2008

Resize your swap partition if Ubuntu Gutsy slow

When I installed Ubuntu on my laptop, I was new to linux and set a swap partition of 1.2Gb although I only had 1Gb of RAM. At some point, I realized it was far too much but it looked like it was impossible to resize without formatting the whole thing!

After the upgrade to Ubuntu Gutsy, my computer was slower and slower because it kept using the swap - sometimes 500Mb - even if some RAM was still available. In an attempt to solve this problem, I changed the vm.swappiness to 0 (ZERO!) in the /etc/sysctl.conf file. I tried all sorts of values, but it did not work.

At the end, after reading an article about GParted live CD, I resized my swap partition to 300Mb and that was it!!! The whole process took 2 hours but now my computer is not using swap at all. I just upgraded it to 3GB and everything is running smoothly :-)

I won't buy a mac in 2008!

After publishing the first version of this post, I came accross a similar post in the excellent ubuntu forum. Because I had changed my swap partition was not even recognized by the OS: that's why it said "0" for swap ;-)
Following the instructions, I could change my config so my new swap partition is detected ...

No comments: