Systemd-analyze tool diagnoses slow Linux boot times

The systemd-analyze utility, built into Linux distributions using the systemd init system, allows users to quickly identify causes of slow boot processes. By running simple commands, it breaks down boot times into kernel and userspace components and highlights delaying services. This tool helps administrators make targeted adjustments to improve startup speeds without guesswork.

Linux users experiencing sluggish boot times on systemd-based distributions, such as Ubuntu or Fedora, can turn to the built-in systemd-analyze tool for rapid diagnosis. As described in technical guides, the tool analyzes the initialization sequence managed by systemd, reporting durations for stages like firmware, bootloader, kernel, and userspace.

Running the basic command systemd-analyze provides a summary of total boot time. For instance, one example shows startup finishing in 6.669 seconds for the kernel plus 30.368 seconds for userspace, totaling 37.037 seconds, with the graphical target reached after 27.479 seconds in userspace. A compact version, systemd-analyze time, offers similar breakdowns, often revealing userspace as the main bottleneck on SSD systems.

The blame option lists systemd units by initialization time, from longest to shortest. Common delays come from services like apt-daily.service (57.158 seconds in one case), which handles daily update checks on Debian-based systems; snapd.service (17.609 seconds); and docker.service (10.647 seconds). Guides advise reviewing this list to identify disableable services, such as deferring container runtimes like Docker if not needed immediately, while cautioning against disabling essential tasks like auto-updates.

For deeper insight, systemd-analyze critical-chain traces the dependency path delaying the default target. An output might show graphical.target waiting on multi-user.target, which in turn depends on docker.service (starting at 16.830 seconds and taking 10.647 seconds). This reveals bottlenecks, such as network wait services or misconfigured mounts causing 30-90 second timeouts.

Finally, systemd-analyze plot > boot.svg generates a visual SVG timeline of the boot process, illustrating parallel and serial dependencies. Opening the file in a browser highlights late-starting units, like those around 18 seconds in sample visuals.

Administrators report significant gains, including 20-40% reductions in userspace time on SSD systems, by applying changes like rescheduling timers or removing unnecessary packages such as cloud-init on non-cloud setups. These modifications should be documented for reversibility, ensuring system reliability.

相关文章

Jeffrey Seathrún Sardina, a machine learning researcher, has created a fork of systemd called Liberated systemd to excise its recently added birthDate field. The field was introduced last week in response to age verification laws in California, Colorado, and Brazil. The fork aims to eliminate what its creator views as surveillance-enabling code while staying in sync with the mainline project.

由 AI 报道

Daemon Tools, a popular disk image mounting app, was compromised in a supply-chain attack starting April 8, delivering malware through official updates. Security firm Kaspersky reported infections on thousands of machines across over 100 countries. Users are urged to scan their systems immediately.

此网站使用 cookie

我们使用 cookie 进行分析以改进我们的网站。阅读我们的 隐私政策 以获取更多信息。
拒绝