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 ...

15 February 2008

Reducing frequency of autotest file checks

I am using RSpec 1.1.3 with ZenTest-3.9.1 and I wanted to share my set up.

If your cpu is at 100% when autotest is running and the fan noise is getting too much, don't worry there's something you can do.

You can reduce the frequency at which autotest checks for changes on your file system by adding an initialize hook in your ~/.autotest configuration:

gedit ~/.autotest



Autotest.add_hook :initialize do |at|
# Reducing frequency of autotest file checks too 30 seconds. Default is 1s which makes my laptop very hoooot
at.sleep = 30

# Ignore files with suffix
%w{.svn
.hg
.git
.rhtml
.png
.txt
.sh
.project
.rjs
.rake
.jpg
.xml
.xlst}.each { |exception| at.add_exception(exception) }
end


More information about autotest hooks in David Chelimsky blog