systemd-analyzeツールがLinuxの遅いブート時間を診断

systemdイニットシステムを使用するLinuxディストリビューションに組み込まれたsystemd-analyzeユーティリティは、ユーザーがブートプロセスの遅延原因を迅速に特定できるようにします。簡単なコマンドを実行することで、ブート時間をカーネルとユーザースペースのコンポーネントに分解し、遅延を引き起こすサービスを強調します。このツールは、管理者が推測せずにスタートアップ速度を向上させるための対象的な調整を行うのを支援します。

systemdベースのディストリビューション、例えばUbuntuやFedoraで起動が遅いLinuxユーザーは、組み込みのsystemd-analyzeツールを使って迅速な診断が可能です。技術ガイドで説明されているように、このツールはsystemdが管理する初期化シーケンスを分析し、ファームウェア、ブートローダー、カーネル、ユーザースペースなどのステージの所要時間を報告します。nn基本コマンドsystemd-analyzeを実行すると、総ブート時間の概要が表示されます。例えば、ある例ではカーネルが6.669秒、ユーザースペースが30.368秒で合計37.037秒、グラフィカルターゲットはユーザースペース内で27.479秒後に到達しています。コンパクト版のsystemd-analyze timeは同様の内訳を提供し、SSDシステムではしばしばユーザースペースが主なボトルネックであることを明らかにします。nnblameオプションは初期化時間でsystemdユニットを長い順にリストアップします。一般的な遅延はDebianベースのシステムで日次更新チェックを扱うapt-daily.service(あるケースで57.158秒)、snapd.service(17.609秒)、docker.service(10.647秒)などのサービスからです。ガイドではこのリストを確認して無効化可能なサービスを特定することを勧め、Dockerのようなコンテナランタイムを即座に必要としない場合は遅らせる一方、自動更新などの必須タスクの無効化には注意を促しています。nnより深い洞察のために、systemd-analyze critical-chainはデフォルトターゲットを遅らせる依存パスを追跡します。出力例ではgraphical.targetがmulti-user.targetを待っており、それがdocker.service(16.830秒開始で10.647秒かかる)に依存していることが示されます。これにより、ネットワーク待機サービスや設定ミスのマウントによる30-90秒のタイムアウトなどのボトルネックが明らかになります。nn最後に、systemd-analyze plot > boot.svgでブートプロセスの視覚的なSVGタイムラインを生成し、並列および直列の依存関係を示します。ブラウザでファイルを開くと、サンプルビジュアルのように18秒前後の遅れて開始するユニットが強調されます。nn管理者は、タイマーの再スケジュールやクラウド環境以外でのcloud-initのような不要パッケージの削除などの変更を適用することで、SSDシステムのユーザースペース時間を20-40%短縮するなどの大きな改善を報告しています。これらの変更は元に戻せるよう文書化し、システムの信頼性を確保すべきです。

関連記事

Illustration depicting the Linux From Scratch 13.0 release as the first systemd-only version, with Tux assembling a PC amid upgraded packages and kernel.
AIによって生成された画像

Linux From Scratch 13.0 released as first systemd-only version

AIによるレポート AIによって生成された画像

The Linux From Scratch project has unveiled version 13.0, marking the first release exclusively using systemd as its init system. This update includes the Linux kernel 6.18.10 and upgrades to 36 packages. The change discontinues the longstanding SysVinit variant after version 12.4.

A recent guide highlights four essential systemd tools that help new Linux users diagnose and fix common system issues. Systemd, the widely used init system in major distributions, provides built-in utilities for managing services, viewing logs, analyzing boot times, and investigating crashes. These tools offer a structured approach to resolving problems without guesswork.

AIによるレポート

A new improvement in the Linux kernel can make hibernation several times faster, particularly when using slow SSDs. This development aims to enhance performance in Linux systems with slower storage devices. The update is highlighted in recent Phoronix coverage.

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によるレポート

The Linux kernel version 7.0 has incorporated updates to its scheduler. These changes feature a time slice extension along with efforts focused on performance and scalability. The updates were reported by Phoronix.

Researchers at LevelBlue have identified a new variant of the SysUpdate malware aimed at Linux systems during a digital forensics and incident response engagement. The malware disguises itself as a legitimate system service and employs advanced encryption for command-and-control communications. By reverse-engineering it, the team created tools to decrypt its traffic more quickly.

AIによるレポート

A tech enthusiast expresses satisfaction with Linux's rapid evolution in update excitement compared to Windows. The author highlights a stark contrast in development timelines for engaging software updates.

 

 

 

このウェブサイトはCookieを使用します

サイトを改善するための分析にCookieを使用します。詳細については、プライバシーポリシーをお読みください。
拒否