Docs / Linux Basics / How to Use systemd-analyze to Debug Slow Boot Times

How to Use systemd-analyze to Debug Slow Boot Times

By Admin · Mar 15, 2026 · Updated Apr 23, 2026 · 185 views · 2 min read

A slow-booting server means longer downtime during reboots and slower recovery from failures. The systemd-analyze tool provides detailed boot timing data to help you identify and fix bottlenecks.

Basic Boot Time Analysis

# Get overall boot time summary
systemd-analyze

# Example output:
# Startup finished in 2.108s (kernel) + 8.542s (userspace) = 10.650s
# graphical.target reached after 8.341s in userspace

# kernel time: Time from kernel start to systemd handoff
# userspace time: Time for systemd to start all services

Identify Slow Services

# List services sorted by startup time
systemd-analyze blame

# Example output:
# 4.521s NetworkManager-wait-online.service
# 1.832s snapd.service
# 1.201s mysql.service
# 0.892s docker.service
# 0.654s nginx.service
# 0.432s ssh.service
# 0.201s systemd-journald.service

# Usually the top 5 services account for most of the boot time

Critical Chain Analysis

# Show the critical path (longest chain of dependencies)
systemd-analyze critical-chain

# Example output:
# multi-user.target @8.341s
# - mysql.service @7.140s +1.201s
#   - network.target @7.120s
#     - NetworkManager-wait-online.service @2.599s +4.521s
#       - NetworkManager.service @2.301s +0.298s
#         - dbus.service @2.105s +0.196s

# This shows mysql.service could not start until
# NetworkManager-wait-online.service completed (4.5 seconds!)

Generate Boot Chart

# Create an SVG visualization of the boot process
systemd-analyze plot > boot-chart.svg

# This generates a timeline showing:
# - When each service started
# - How long each service took
# - Dependencies between services
# - The critical path highlighted

# Transfer to your local machine to view:
scp deploy@server:/home/deploy/boot-chart.svg ./

Common Bottlenecks and Fixes

NetworkManager-wait-online.service

# This is the #1 cause of slow boots — it waits for network connectivity
# On a VPS with static networking, you can often disable it:

# Check if it is causing delays
systemd-analyze blame | grep -i network

# Disable if not needed (VPS with static IPs via cloud-init)
sudo systemctl disable NetworkManager-wait-online.service
sudo systemctl mask NetworkManager-wait-online.service

# Alternative: reduce the timeout
sudo mkdir -p /etc/systemd/system/NetworkManager-wait-online.service.d/
cat         

Was this article helpful?