Troubleshoot Boot-Up Performance in Linux with systemd-analyze

By | 2015/07/26

A great feature of systemd is the command systemd-analyze. Here are some quick ways to use systemd-analyze to troubleshoot boot-up times and systemd unit loading performance!


Firstly, just running systemd-analyze will provide the complete boot-up time, including desktop userspace if applicable.

$ systemd-analyze 
Startup finished in 2.952s (kernel) + 1.737s (userspace) = 4.689s

Next, to dig deeper into the boot-up process and timing, tack on blame. This will list the systemd units ordered by initialization.

$ systemd-analyze blame
           442ms systemd-journal-flush.service
           382ms systemd-remount-fs.service
           349ms alsa-restore.service
           342ms systemd-user-sessions.service
           259ms NetworkManager.service
            82ms home.mount
            80ms systemd-udevd.service
            70ms udisks2.service
            58ms cups.service
            49ms systemd-journald.service
            45ms systemd-fsck-root.service
            43ms nginx.service
            42ms media-seagate.mount
            41ms user@1000.service
            38ms media-wdtb.mount
            34ms polkit.service
            33ms systemd-udev-trigger.service
            23ms systemd-modules-load.service
            19ms systemd-tmpfiles-setup-dev.service
            19ms sys-kernel-debug.mount
            18ms sshd.service
            17ms dev-hugepages.mount
            16ms dev-mqueue.mount
            14ms kmod-static-nodes.service
            14ms systemd-sysctl.service
             8ms sys-fs-fuse-connections.mount
             7ms systemd-logind.service
             6ms systemd-vconsole-setup.service
             6ms systemd-random-seed.service
             5ms upower.service
             3ms systemd-update-utmp.service
             3ms systemd-tmpfiles-clean.service
             3ms systemd-tmpfiles-setup.service

This makes it easy to see which part of the boot-up process may be causing the system to have a slow startup.


A couple of other fancy things you can do:

– Create an svg chart of the last boot

$ systemd-analyze plot > output.svg

Below is an example png from that command:

systemd-output

– Dump out verbose boot-up information

To troubleshoot any boot-up issues, try using dump to get an extremely verbose output.

$ systemd-analyze dump > out.txt

Later,