Improving boot performance with Bootchart

What to Cut

When optimizing boot times, you will mainly be interested in the vectors between various processes starting on the vertical axis. How long does a process wait before it allows the next process to start? Do some processes block the boot procedure for an excessively long time? Do I have any options for parallelizing some of the boot processes?

On the horizontal axis you will want to see whether you really need all the active processes. To do so, first correctly identify the processes and evaluate their functions; however, do not uninstall the programs or move their init scripts (e.g., hwclock.sh) to another directory until you are absolutely certain that your system does not need the process to survive. These optimizations involved very little effort and reduced the boot time in our lab from 33 to 26 seconds (Figure 3) – all without massively invasive system tweaking.

Figure 3: Targeted uninstalling of programs will reduce the boot time. In our lab, we managed to save seven seconds.

No universal recipe exists for accelerating the boot process. Many Linux distributions use Bootchart to optimize the boot time for the default installation, but you are likely to find even more time-saving options on your own computer. In our lab, we uninstalled Samba, Tor/Privoxy, and Bluetooth and moved the hwclock.sh init file to reduce the boot time. If you only print occasionally, you don't need to launch CUPS when you boot the system; instead, you could disable the CUPS daemon by default and move the start script out of the /etc/init.d/ folder. The same principle applies to other services that you only use occasionally – but remember to create backup copies before you make any changes to the scripts.

After taking care of the more obvious choices, such as disabling various automatically loaded services, you need to tackle some of the more complicated options for accelerating the boot process. These subtler alternatives mainly relate to the kernel and other system components.For example, you could build in hardware support modules and completely do without initrd and initramfs. Doing without hwclock, the tool that sets the system clock, is not as significant, but it could still save you some time. Then, once the system boots, cron could handle this job on a regular basis.

Hardware optimization options include booting the CPU at the fastest supported clock speed (if this is not done automatically). Also, you can save time with the Udev daemon: Whenever a machine is booted, the daemon tries to detect and enable all the devices. To save yourself this long-winded search, run a script by Phil Endecott (the guy who optimized Debian to 14 seconds) to automatically mount all the devices it has detected in /dev at boot time. However, this optimization comes at the price of losing the flexibility of plugging in new hardware.

Conclusions

Bootchart does not give you specific tips for accelerating your system boot time, but it does show you what is slowing the system down. Then you need to draw your own conclusions to know where to tweak the boot process. Of course, there is always the danger of optimizing your system to death and losing any time you gained in complicated repairs. Before you do anything serious, make sure you know exactly what effect the change will have on your system.

Infos

  1. Moblin boots in five seconds: http://www.linuxdevices.com/news/NS7654890804.html
  2. Bootchart: http://www.bootchart.org

Buy Linux Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • Debian: 14 Seconds to Boot

    An article from the Debian-Administration.org community describes how to boot up Debian much faster on an Asus Eee 901. Its author, Phil Endecott, claims to do it within 14 seconds using his method.

  • Charly's Column Bootchart

    What could be more boring than watching a computer run through an error-free boot routine? Why watch for messages that may never appear? Every second you save adds to your valuable leisure time. Bootchart helps you find those valuable leisure moments.

  • Upstart

    The slow Linux boot has troubled users for years. Now the Upstart project offers a fresh approach to the problem of booting Linux.

  • Optimizing System Startup

    Today's Linux systems boot faster than ever, but many users still get impatient waiting for that first glimpse of desktop. These tweaks will help you get a faster start from the bootloader and kernel.

  • The sys admin's daily grind: systemd-analyze

    In sys admin columnist Charly's case, no fumbled system startup goes undetected. This was already the case with SysVinit and has not changed with systemd. In terms of the his analysis tools, no stopwatch goes unturned.

comments powered by Disqus
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters

Support Our Work

Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.

Learn More

News