brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: systemd-analyze blame shows which services slow down your boot

Systemd
~/tips/tip-systemd-analyze-blame

systemd-analyze blame

Lists every service by how long it took to start during the last boot, slowest first.

A Linux box that takes long to boot is annoying, and guessing which service is guilty is a waste of time. systemd measures it for you.

systemd-analyze blame

The output is a list of units with the time each one needed to start, longest first. A line like 12.4s docker.service tells you where the seconds went. The command works on a normal user account and reads data from the boot that just happened.

Run plain systemd-analyze first for the total: it splits boot time into firmware, loader, kernel and userspace.

A long time in blame does not always mean that service held the boot up. A unit can take ten seconds while other things keep starting beside it. To see the chain that really delayed things, use:

systemd-analyze critical-chain

That prints the tree of units that boot had to wait for, with the times behind them. If a network wait service shows up near the top on a server, that is often a hint to look at your network configuration, not at the service itself.

The numbers are only for the last boot. Reboot and run it again to see whether a change helped.

Further reading: systemd-analyze manual (freedesktop.org)

More Systemd tips [Service] sudo mkdir -p /etc/systemd/system/service.d [Service] printf 'hunter2' | sudo systemd-creds encrypt --name=dbpass – dbpass.cred systemd-analyze timespan 1h30min All Systemd tips (88) All topics

Link