Booting with an SSD
Following on from our earlier article about upgrading from a traditional hard disk to an SSD, we tested that old metric, boot time.
We used the excellent bootchart tool to gather these statistics. It's worth noting that time for the BIOS to post takes quite a long time (about another 30 seconds). We are only timing from kernel load to end of startup.
Our starting point was the old hard disk (7200rpm WD RE2), whilst the system had been tuned previously (dropping it from 42secs to 22secs at one point), it had crept back up to 31 seconds, disk read peaking at 17MB/s.
A simple swap to the SSD boosted the disk read peak to 55MB/s but much more importantly almost halved the startup time to 16 seconds.
Looking at the boot chart it was clear that there was some simple changes that could be made. One technique that can be useful is to move most services out of the default run level, leaving just the core services (and the login manager) and then have a delayed script at the end which changes the runlevel to another one which starts the remaining services.
By using this technique on some less important mount points (music files and virtual machine images), the time dropped further to 14 seconds.
We then moved other services to this secondary run level and shaved a further two seconds, reducing the boot time down to just 12 seconds.
Most of the time remaining is harder to reduce - almost a third of it appears to be kernel initialisation, removing unused modules, compiling in more code and avoiding an initrd would help.
hwclock is always a bit of a bug bear as it has to poke some fairly grotty hardware. It's probably fairly safe to move this into the deferred run level.
net.agent (part of udev) sleeps seven times, each time for one second. This could perhaps be lowered, saving perhaps 0.5seconds, however it's not clear that this is causing any delay to the boot process. It appears to be waiting for the "lo" or loopback interface to be marked as up (well, anything other than "down" in fact).
| Attachment | Size |
|---|---|
| bootchart.png | 171.02 KB |
| bootchart.png | 99 KB |
| bootchart.png | 84.72 KB |
| bootchart.png | 75.5 KB |