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 plot draws your boot as an SVG timeline

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

systemd-analyze plot > boot.svg

See in one picture which units start in parallel and which ones hold up the boot.

systemd-analyze blame gives a list of times, but it does not show what ran at the same time. A picture of the boot does.

systemd-analyze plot > boot.svg

The result is an SVG file you can open in any browser. Every unit gets a bar from the moment it started activating to the moment it was active, with colors for the different phases. The file can easily come out around 880 pixels wide and taller than a screen, with the kernel and userspace time at the top.

The thing I’d look for is long bars that everything below them waits on. A network-online.target or a disk mount that keeps a whole group of services in line is easy to spot here, and easy to miss in a list. Bars that overlap are fine; they ran in parallel.

Copy the file to your own machine to view it if the server has no desktop:

scp server.example.com:boot.svg .

The plot covers the last boot only, and the times include waits for things like DHCP or a slow disk to wake up. A unit with a long bar is not always slow itself; check systemd-analyze critical-chain unit.service to see what it was waiting for.

Further reading: systemd-analyze man page

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