Reducing boot time on Fedora 16

I bought a brand new ThinkPad X220 Tablet and was a little disappointed about the long lasting boot sequence of Fedora 16 compared to the pre-installed Windows 7. I decided to investigate this issue to reduce the boot time.

First of all, how long does the boot sequence take? This can be determined by executing the following command

[ ~]$ systemd-analyze

Startup finished in 2235ms (kernel) + 3784ms (initramfs) + 100999ms (userspace) = 107019ms

This tells us that 2235ms have been used for kernel initialization. After that the initial ramdisk has been loaded which took 3784ms. The initial ramdisk is necessary because I use LVM. There is not much chance to reduce these values. But, loading daemons in userspace consumes about 100s. This is far too much!

The systemd-analyze command takes three command line arguments.

systemd-analyze time
systemd-analyze blame
systemd-analyze plot

The time argument is the default and has been implicitly executed before. The plot command provides us with a nice graphical representation of the boot process as shown below.

The blame argument prints all services with their startup time in descending order.

[ ~]$ systemd-analyze blame
  7585ms iscsi.service
  5181ms bluetooth.service
  4745ms NetworkManager.service
  4454ms chronyd.service
  3744ms avahi-daemon.service
  3470ms abrt-vmcore.service
  3438ms irqbalance.service
  3427ms sshd-keygen.service
  3395ms rsyslog.service
  3162ms systemd-logind.service
  2928ms dbus.service
  2230ms abrt-ccpp.service
  2089ms console-kit-log-system-start.service
  2019ms udev-settle.service
  1985ms livesys.service
  1736ms mcelog.service
  1650ms iptables.service
  1635ms ip6tables.service
  1618ms auditd.service
  1522ms fedora-wait-storage.service
   488ms netfs.service
   488ms fedora-storage-init.service
   483ms iscsid.service
   437ms fcoe.service
   170ms udev-trigger.service
   161ms remount-rootfs.service
   154ms systemd-remount-api-vfs.service
   148ms fedora-loadmodules.service
   143ms systemd-sysctl.service
   140ms systemd-vconsole-setup.service
   118ms systemd-readahead-collect.service
    90ms sandbox.service
    84ms systemd-readahead-replay.service
    81ms mdmonitor-takeover.service
    80ms fedora-storage-init-late.service
    78ms fedora-readonly.service
    73ms dev-mqueue.mount
    69ms dev-hugepages.mount
    63ms media.mount
    61ms systemd-tmpfiles-setup.service
    58ms sys-kernel-security.mount
    53ms sys-kernel-debug.mount
    48ms boot.mount
    48ms lvm2-monitor.service
    47ms console-kit-daemon.service
    41ms udev.service
    31ms sys-kernel-config.mount
    17ms livesys-late.service
    16ms accounts-daemon.service
     8ms systemd-user-sessions.service
     6ms rtkit-daemon.service
     5ms home.mount
     0ms sys-fs-fuse-connections.mount

My approach is to work through that list top down by deciding if this service must be started at boot time. I disable each service I don’t consider necessary. The command systemctl -t service prints a list of services with a short description. These descriptions and the help of google search are the foundations for my decisions.

I do not use iSCSI. Therefore, I disable the corresponding service at startup.

[ ~]$ sudo systemctl disable iscsi.service
iscsi.service is not a native service, redirecting to /sbin/chkconfig.
Executing /sbin/chkconfig iscsi off

The same applies to

  • bluetooth.service
  • ip6tables.service
  • fedora-wait-storage.service
  • sendmail.service
  • udev-settle.service
  • sshd-keygen.service
  • livesys.service

These reduced my boot time to about 15 seconds and there is still some space for improvements.

[ ~]$ systemd-analyze
Startup finished in 1440ms (kernel) + 2995ms (initramfs) + 10700ms (userspace) = 15136ms

References

Appendix

Bluetooth (2012-05-09)

Since I don’t start bluetooth.service at boot time I have to load the service when I want to use bluetooth. This is as simple as doing

[ ~]$sudo systemctl start bluetooth.service

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.

Time limit is exhausted. Please reload the CAPTCHA.