Learn how to start problems with systemd compatible machines with the systemd analysis tool.
Image: Jack Wallen
Your Linux data center servers probably use systemd as an initialization system. That is why you may be interested in the knowledge that a tool is available that can analyze the boot performance of your server. The tool is called systemd analysis and I will show you how to use it.
SEE: 10 things that companies store in their own data centers (TechRepublic download)
What you need
The only thing you need to make this possible is a Linux system with system support and a user account with sudo rights.
How to install systemd analysis
Good news. No installation is required because systemd analysis is part of the systemd suite of tools. You can confirm that the tool has been installed by giving the command:
which systemd analysis
You should see the path to the executable command (Figure A).
Our systemd analysis executable path.
How to analyze systemd
Now we carry out the analysis assignment. First, let’s find out the actual machine startup time by executing the command without arguments, like this:
sudo systemd analysis
As you can see (in Figure B) the total start-up time of my System76 Thelio is 55,252 seconds.
Total start-up time for the machine.
This start-up time is subdivided into:
If that time is too long for you, how do you find out what the culprit is? I’m glad you asked. Give the command:
sudo systemd analysis debt
The command above provides a list of each service that is started on the machine and the time it takes (Figure C.). For example, on my computer the biggest offenders are:
NetworkManager-wait-online: 6,401 seconds
Plymouth stop wait: 2,793 seconds
E2scrub_all: 2,002 seconds
Snap core: 283 ms
Snap bluemail: 253 ms
Udisks2: 251 ms
Solved system: 250 ms
Logrotate: 238 ms
Dev-nvme0n1p3: 232 ms
All services and their start-up time.
That list continues to blame a good number of services, most of which are less than 100 ms. It is clear that I have nothing that causes long delays during startup. However, if a service causes such a delay, it will be listed and you can begin to resolve the cause.
You can also have the command print the results in a series of events with the command:
sudo systemd analysis of critical chain
The results show the time when a unit became active, as a series of events (Figure C).
The critical chain display.
And so you can use the built-in systemd tool to help you solve problems why your Linux systems start up slowly. For more information about the systemd analysis tool, issue the man systemd analysis command and read all about it.
Datacenter Trends Newsletter
DevOps, virtualization, the hybrid cloud, storage and operational efficiency are just a few of the topics of the data center that we will discuss.
Delivered on Monday and Wednesday