Startup Scenes
Charly's Column – systemd-analyze
In sys admin columnist Charly's case, no fumbled system startup goes undetected. This was already the case with SysVinit and has not changed with systemd. In terms of the his analysis tools, no stopwatch goes unturned.
If a distribution shows its splash screen on startup – and almost all of them do – then I turn it off as of the second boot. I want to see the kernel messages rushing by when booting. Because more often than you might think, there's a problem with booting. When I see something questionable scurry by, I search with a tool like Bootchart [1] to find and fix a hanging process or similar issues quickly.
On systems with systemd, this is also possible in principle, but the tool is different: systemd-analyze
. When called without parameters, systemd-analyze
calculates the elapsed time until system startup is completed, broken down into kernel and userspace processes:
Startup finished in 3.507s (kernel) + 16.334s (userspace) = 19.842s
Of course, I want to know more about those processes now. The command systemd-analyze blame
gives me a list of all processes started at boot time. They are sorted by the elapsed time before the process has fully launched. I usually only see the 10 biggest time hogs, as shown in Listing 1.
Listing 1
systemd-analyze blame | head
1min 3.753s apt-daily.service 40.702s apt-daily-upgrade.service 8.649s fail2ban.service 4.246s networking.service 3.327s smokeping.service 2.622s apache2.service 2.303s mysql.service 2.206s postfix.service 1.835s dev-sdb1.device 993ms munin-node.service
In this particular case, I can ignore the candidates in lines 1 and 2 – they appear if the system performs unattended updates or upgrades on startup. Fortunately, they do not block any other processes and simply wriggle around a bit in the background. systemd-analyze
does not calculate them for this reason, as can already be seen from the sums.
Serial Plot
With the plot
parameter, I can create a kind of timeline in SVG format, which shows the boot process in a very clear graphical way. For this to work, the graphwiz package must be installed. The command is then:
systemd-analyze plot > systemd-boot.svg
Figure 1 shows a small section of the results. The start time of the individual processes is symbolized here by a red bar. Not only the start order and times, but all the dependencies between the services, can be summarized by the tool in the form of an SVG graphic:
systemd-analyze dot | dot -Tsvg > dependencies.svg
Caution: The result is really huge and probably only makes life easier for owners of A1-sized plotters.
Infos
- Bootchart: http://www.bootchart.org
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
News
-
AlmaLinux 10.0 Beta Released
The AlmaLinux OS Foundation has announced the availability of AlmaLinux 10.0 Beta ("Purple Lion") for all supported devices with significant changes.
-
Gnome 47.2 Now Available
Gnome 47.2 is now available for general use but don't expect much in the way of newness, as this is all about improvements and bug fixes.
-
Latest Cinnamon Desktop Releases with a Bold New Look
Just in time for the holidays, the developer of the Cinnamon desktop has shipped a new release to help spice up your eggnog with new features and a new look.
-
Armbian 24.11 Released with Expanded Hardware Support
If you've been waiting for Armbian to support OrangePi 5 Max and Radxa ROCK 5B+, the wait is over.
-
SUSE Renames Several Products for Better Name Recognition
SUSE has been a very powerful player in the European market, but it knows it must branch out to gain serious traction. Will a name change do the trick?
-
ESET Discovers New Linux Malware
WolfsBane is an all-in-one malware that has hit the Linux operating system and includes a dropper, a launcher, and a backdoor.
-
New Linux Kernel Patch Allows Forcing a CPU Mitigation
Even when CPU mitigations can consume precious CPU cycles, it might not be a bad idea to allow users to enable them, even if your machine isn't vulnerable.
-
Red Hat Enterprise Linux 9.5 Released
Notify your friends, loved ones, and colleagues that the latest version of RHEL is available with plenty of enhancements.
-
Linux Sees Massive Performance Increase from a Single Line of Code
With one line of code, Intel was able to increase the performance of the Linux kernel by 4,000 percent.
-
Fedora KDE Approved as an Official Spin
If you prefer the Plasma desktop environment and the Fedora distribution, you're in luck because there's now an official spin that is listed on the same level as the Fedora Workstation edition.