How to Use systemd-analyze to Check Boot Time in Ubuntu

If you notice that your Ubuntu machine is taking an unusually long time to boot up, guessing which background service or hardware component is causing the delay is nearly impossible. Fortunately, modern Ubuntu distributions use the systemd init system, which includes a highly detailed profiling tool called systemd-analyze.

This command-line utility tracks exactly how many milliseconds it takes for the kernel, the initramfs, and every individual background service to load during the startup process. By using this tool, you can pinpoint the exact cause of a slow boot and take steps to disable unnecessary services.

Step 1: Get a High-Level Boot Time Summary

To get a quick overview of how long your system takes to boot, open your terminal and type:

systemd-analyze

The output will look something like this:

Startup finished in 3.125s (kernel) + 4.512s (userspace) = 7.637s.
graphical.target reached after 7.500s in userspace.

This tells you the total boot time and breaks it down into two main phases:

  • Kernel: The time it takes for the Linux kernel and early boot environments to initialise hardware.
  • Userspace: The time it takes for Ubuntu’s system services, network managers, and graphical interface to load. If your boot is slow, the problem almost always lies in the userspace.

Step 2: Find Out Which Services Are Delaying the Boot

To see a detailed breakdown of the userspace boot time, use the blame command. This lists every service that started during boot, ordered by how long it took to initialise (slowest at the top).

systemd-analyze blame

You will see a list resembling this:

8.541s NetworkManager-wait-online.service
2.105s snapd.service
1.002s plymouth-quit-wait.service
 750ms systemd-logind.service
 400ms ufw.service

Note: The times shown are how long each service took to initialise, but many services start simultaneously in parallel. Therefore, adding up all the numbers in the “blame” list will result in a number much higher than your actual total boot time.

Common Culprits of Slow Boot Times

  • NetworkManager-wait-online.service: This service forces the boot process to pause until an active network connection is established. If you are on a slow Wi-Fi network or not connected to a cable, this can add 10 to 30 seconds to your boot time.
  • snapd.service: The daemon responsible for managing Snap packages. It often takes a few seconds to verify installed snaps.
  • apt-daily.service / apt-daily-upgrade.service: These services check for software updates in the background.

Step 3: Visualising the Boot Process

Sometimes, the blame command is misleading because a service might take a long time to load, but it loads in the background without delaying the final graphical desktop.

To see exactly how services depend on each other and which ones form the “critical chain” (the sequence of services that must finish before the desktop appears), use:

systemd-analyze critical-chain

This output highlights the exact path of dependencies delaying the graphical.target (the login screen).

Step 4: How to Disable Unnecessary Services

If you identify a service that is significantly delaying your boot time and you are certain you do not need it, you can disable it using the systemctl command.

For example, if the NetworkManager-wait-online.service is adding 15 seconds to your boot time and you do not run network-dependent server applications that require a connection immediately at startup, you can safely disable it:

sudo systemctl disable NetworkManager-wait-online.service

If you find that a service like ModemManager.service (used for dial-up or cellular modems) is running, but you only use Ethernet or Wi-Fi, you can disable it to save a few milliseconds:

sudo systemctl disable ModemManager.service

Warning: Do not randomly disable services just because they take a few seconds to load. Disabling core systemd components or graphical drivers will break your Ubuntu installation. Always research a service online before disabling it.

By regularly checking systemd-analyze, especially after installing new software or upgrading your distribution, you can maintain a clean, highly optimised Ubuntu system that boots in seconds.

Leave a Reply

Your email address will not be published. Required fields are marked *

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.