06 January 2010 ~ 3 Comments

Accelerate your tests in Rails with Ubuntu

I recently came across a blog post about accelerate Ubuntu disk access perfomrance.

You can read it on Smartlogic blog, it’s well explained so I’n not going to copy but I just would like to add some ideas:

You don’t need to boot on a live CD

Where Nick ask to boot on a live CD and mount your partitions, you don’t really need this part.

First open your /etc/fstab file and spot your active partitions.

For example on my development machine, I use /dev/sda1 for my / and /dev/sda6 for my /home

Close the file and run

sudo tune2fs -o journal_data_writeback /dev/sdXY

on each partitions you’ll need to tweak.

Apply noatime and data=writeback to all your working partitions

As you’ve done tune2fs on each partitions, you’ll need to change the mounting options (noatime and data=writeback) in each partitions line inside your fstab.

Do not do it on your server!

Because these modifications make the file system more fragile if crashing, please do not consider doing these tweaks on your production servers.

Enjoy the boost

Where Nick claim a 30% speed gain on his machine, I can claim a gain of more that 55% as I went down from 55 minutes to 25 minutes for the same test suites on one of the biggest application I work on!

Was it useful?

Thanks a lot to Nick Gauthier for his initial blog post, I hope it will be useful to some of you.
Let me know in the comments if you know other tweak that can make my little machine works faster.

3 Responses to “Accelerate your tests in Rails with Ubuntu”

  1. Nick Gauthier 6 January 2010 at 3:33 pm Permalink

    Hey Nicolas,

    glad you found it useful! Nice find on not having to boot to a recovery CD. If you want to speed your test up even more, check out the gem multitest, which allows your tests to run in parallel on a multi-core or hyperthreaded machine.

    Nick

  2. Nicolas 6 January 2010 at 3:39 pm Permalink

    Hehe, I’ve seend that last week but … I’m working on a single core machine at the moment (ie:crazy!). Thanks for the advice ;)


Leave a Reply