Ubuntu Readahead boot profiling, and Bootchart

Posted by on Feb 24, 2008 in Technology, Ubuntu4 comments

I’ve been messing around, tweaking and poking my system in an attempt to optimise, and speed things up a little. Installing 2Gb RAM has helped, but I’ve also been playing trying to speed up my laptop’s boot time. I stumbled across a cool little application, called bootchart:

“boot sequence auditing and chart generator
bootchart allows you to audit the boot sequence of your computer and
generate a pretty chart of the processes run, including how long they
took and how much CPU and I/O they used.

The auditing is performed by adding a script to the top of your initramfs
which lives inside is own tiny filesystem during the boot process and
monitors the rest of the system booting”

(description from the Synaptic Package Manager)

So, I installed bootchart

sudo apt-get install bootchart

and rebooted to benchmark the boot time – 44 seconds (bootchart creates a cool png image in /var/log/bootchart each time the computer boots up). Not bad, but surely it could be a little better, right?

Aside from the obvious optimisation tricks of turning off unnecessary services, I’d also heard about readahead, which can be used to cache files to be loaded at boot time. To enable it, all I had to do was create a boot profile, which can be done via Grub at boot time. So, I rebooted again, and when the Grub boot list appeared, created the profile:

First, I highlighted the default boot option – actually it was already highlighted, since it’s what I usually boot into! – and pressed the “e” key. Then I scrolled down to the “kernel” line, and pressed “e” once again, which allows a temporary edit of the Grub boot command line. Moving the cursor to the end of the line, I added ” profile” (notice the space character before the word profile), pressed “Enter”, and booted. It took longer than usual, obviously, since readahead was creating the profile to, well, read ahead on the next, and all subsequent boots.

After my system had fully booted into Gnome, I rebooted, waited, then checked the bootchart log again. 42 seconds…

Oh well – a couple of seconds improvement is better than nothing! Back to the drawing board…

Tags: , , , , ,