bootwhy is a small command-line tool for Linux that helps you understand why your system boots slowly. It inspects boot performance data (for example from systemd-analyze and system logs), highlights the slowest services and phases, and prints a concise summary so you can see which components are responsible for most of the boot time.
Install bootwhy from the project directory:
pip install .After installation, the bootwhy command will be available in your PATH.
You can also run bootwhy directly without installation:
python -m bootwhyNote: Make sure you have the src directory in your Python path, or run from the project root.
Run bootwhy without any arguments to see a summary of boot time and the top 5 slowest services:
bootwhyExample output:
Total boot time: 12.345s
Kernel: 2.100s
Userspace: 10.245s
Top 5 slowest services:
1. NetworkManager-wait-online.service 5.123s
2. systemd-udev-settle.service 2.456s
3. plymouth-quit-wait.service 1.234s
4. systemd-journal-flush.service 0.890s
5. systemd-tmpfiles-setup.service 0.567s
Use --top N to display a different number of slowest services:
bootwhy --top 10Use --summary (or -s) to show only the boot time summary and the top 3 slowest services:
bootwhy --summaryUse --critical-chain (or -c) to display the critical chain analysis:
bootwhy --critical-chainThis shows the dependency chain of the slowest services during boot, formatted by systemd-analyze.
Use --raw to display all collected data in JSON format:
bootwhy --rawUse --version (or -V) to display the version number:
bootwhy --versionUse --help (or -h) to display the help message:
bootwhy --help| Option | Short | Description |
|---|---|---|
--help |
-h |
Show help message and exit |
--version |
-V |
Show version number and exit |
--summary |
-s |
Show only boot time summary and top 3 services |
--top N |
Number of top slowest services to display (default: 5) | |
--critical-chain |
-c |
Show critical chain analysis |
--raw |
Show raw data in JSON format |
bootwhy requires systemd-analyze to be available on your system. It is designed to work with Linux distributions that use systemd as their init system.
If you run bootwhy on a system without systemd or without systemd-analyze installed, you will see a clear error message:
bootwhy: error: bootwhy requires systemd-analyze. Please install systemd or run on a systemd-based distribution.
Some systemd-analyze commands may require certain permissions to access boot data. If you encounter permission errors, try running bootwhy with appropriate privileges (e.g., using sudo if necessary, though this is typically not required for reading boot performance data).
bootwhy currently does not support non-systemd init systems. On systems without systemd, the tool will gracefully exit with an error message.
- Python 3.7 or higher
- Linux system with systemd and
systemd-analyzecommand - Standard Python library only (no external dependencies)
This project is licensed under the GNU General Public License v3.0 (GPLv3).
See the LICENSE file for the full license text.
Contributions are welcome! Please feel free to submit issues, feature requests, or pull requests.