Have you ever checked how long your system takes to boot? Generally, it all occurs within seconds or a few minutes but we do not know the exact time. Regardless of the reason why you want to know it, there is a systemd-analyze utility that can let you know the exact time your Linux system takes to boot.
In this article, you will learn to find how long your Linux system takes to boot and how to reduce this time if it is booting slowly.
- How to check for how long does our system take to boot?
- Investigate/Troubleshoot slow bootup
- How to disable slow bootup services?
- How to find CPU utilization, what makes the system to hang
So how to check for how long does our system take to boot?
Open the terminal and type systemd-analyze you will recive the following info:
# How long does your Linux system take to boot? systemd-analyzeCode language: PHP (php)
Here we can see that our startup finished in 1.2 seconds for the kernel and we have extra 31 seconds for applications like graphics and so on and we have the summary full boot after 31.7 seconds.
If we want to: Investigate/Troubleshoot slow bootup
Now if we think that the boot time is very slow or your system boots for minutes we can use the blame option to check what is slowing us down like in the following screenshot:
# How to Investigate/Troubleshoot slow bootup systemd-analyze blameCode language: PHP (php)
From this screen we can see clearly which service is slowing us for example 30.225 seconds for playmouth-quit-wait-service and that’s very high.
If you want to see only the 10 top slow bootup services you can use blame head like in the following example:
# How to Investigate/Troubleshoot slow bootup systemd-analyze blame | headCode language: PHP (php)
You can also print the output in the form of a tree of the time-critical chain of events. Use the following command in the terminal like the next example:
# How to Investigate/Troubleshoot slow bootup systemd-analyze critical-chainCode language: PHP (php)
And how to disable slow bootup services?
Now we know which services to blame for our slow bootup but how to disable them? For this task we are going to use systemctl disable like in the following example:
# How to disable slow bootup services? sudo systemctl disable the-service-you-want.serviceCode language: CSS (css)
Systemd-analyze is a great tool for inspecting the Linux boot time with great features. If you know other ways to inspect the system please tell us in the comments bellow.
- Another interesting article is: How to find CPU utilization, what makes the system to hang