APC Australia

Removing bottleneck­s

-

After identifyin­g the bottleneck­s responsibl­e for slow boot times, you can use the systemctl command to stop and disable unwanted services. For instance, in the example discussed above, smdb, nmdb and networkman­ager are some of the services that are holding back other services.

To stop these services and disable them so that they don’t start at boot, run the following commands:

$ sudo systemctl stop smdb

$ sudo systemctl disable smdb

The first command only stops the currently running service, but the second command ensures that the service won’t be started automatica­lly at boot. However, even after you disable a service, you might still find it running during a subsequent reboot. This happens when another service depends on a disabled service and starts it. You can get a list of services that might start another service, for instance, smdb or snapd with the systemd-analyze blame | grep ≤service≥

command. For instance, the command systemd-analyze blame | grep snapd will display all the child services that need a parent service.

For a list of all enabled services, you can run the systemctl list-unitfiles | grep enabled command.

982f7286\x2d84f5\x2d48e5\ x2d807e\x2de208361­fb≥

dev-disk-by\ x2duuid-982f7286\x2d84f5\ x2d48e5\x2d807e\x2de208361≥ lines 1-12/12 (END)

The data generated by systemdana­lyze can be plotted into a graph for easy assimilati­on.

Run the systemd-analyze plot > /tmp/systemd-chart.svg command to generate a SVG chart in the /tmp directory. You can optionally create the chart in any other directory of your choice, if you wish to retain it for future reference.

The command create a SVG file, which is a text file that defines a series of graph vectors. This can

then be used by applicatio­ns such as Image Viewer, Ristretto, LibreOffic­e Draw to generate a graph. These applicatio­n can use the data in a SVG file to create an image.

The resulting graph is huge, and you have to zoom in considerab­ly to be able to make sense of the presented data. The graph displays all the services that started at boot, as well as the time it took to start and all dependenci­es. The critical path for the different services is highlighte­d in red. Please read the man page of systemd-analyze if you wish to make the most of its capabiliti­es for system manager debugging.

 ??  ?? We’ve only covered the most commonly used options of systemd-analyze, but there’s plenty more that you can do with it.
We’ve only covered the most commonly used options of systemd-analyze, but there’s plenty more that you can do with it.

Newspapers in English

Newspapers from Australia