First Time Linux

With the Mandriva update, I noticed that the boot was taking considerably longer than before, and in particular was pausing for several seconds with the message "Starting portmapper". Since I didn't really think I needed my ports to be mapped, I investigated removing this to speed things up a bit. But before I did that, I stumbled across Bootchart, a utility to monitor what's going on with the whole boot process.

Monitoring using bootchart

Bootchart promises to record what happens during boot up of your system, and try to spot ways in which the process can be optimised. Maybe services can be removed if they're taking a while, or the orders of things could be changed to make better use of the system resources during the boot.

The download and installation went relatively smoothly, and I ended up with a new option in my boot selection screen. As well as "linux", "windows" and "failsafe" I now have an extra one called "bootchart" which records things as it goes - otherwise it's the same as "linux". After booting (well, actually a few minutes later), a file appears called /var/log/bootchart.tgz which can then be analysed either with the included java tool running locally, or by uploading to the web-based tool at bootchart.org.

In my case, trying to read my resulting trace file just gives a java NullPointer from the web-based tool, which is not too helpful. The compilation of the source to run locally requires ant, and ant requires java-devel, and even though I've got a java sdk, it wasn't in an rpm so my java-devel dependency is unsatisfied. Bah.

After manually compiling the source with javac and correcting the NullPointer bug, it now gives a pretty Gantt-chart-style picture of my boot process but also of the following four minutes, not sure why.)

The initial chart

Initial boot chart

Here is an extract of the first chart, edited to save space. The important things to note are the gaps in the CPU activity, time spent doing essentially nothing. Clearly a big culprit is "portmap", which confirms the pause observed during startup.

Obviously there's a lot more detail in the original chart than this, and an experienced eye could tell you a lot more about what it means, but as it is I'm mainly bothered by these pauses, and how to speed the whole thing up just a little.

Optimising

Removing the automatic starts of portmapper, bluetooth and ultrabayd have speeded up the boot by around 20 seconds or so:

Second boot chart

Now it no longer has the pause for portmapper, and the process as a whole is speeded up, but it does seem that the CPU and the disk are both busier. I'm not sure whether this is a real effect due to other software that's been added in the meantime, or whether it's just a graph artefact.

There's still a short pause for harddrake, but I'll let that go for now. The main thing is that the boot is quicker, which it definitely is. The other details in the chart can be left for later inspection to see if anything else needs to be changed.

Links