• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

The Geek Diary

CONCEPTS | BASICS | HOWTO

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • Linux Services
    • VCS
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
    • Data Guard
  • DevOps
    • Docker
    • Shell Scripting
  • Interview Questions
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

CentOS / RHEL 7 : systemd-analyze command to find booting time delays

By admin

Question : My system is taking a lot of time to boot. How can I find out which services are taking long time to start?

Answer :

systemd-analyze command can be utilized to find out information about how much each service took to start. systemd-analyze time can provide overall information about how long it took system to start. Here is a command out which clearly shows the time taken by kernel, initrd and userspace while booting.

# systemd-analyze time
Startup finished in 1.267s (kernel) + 6.798s (initrd) + 1min 2.139s (userspace) = 1min 10.205s

To find out, how much time each unit took to start, run systemd-analyze blame.

# systemd-analyze blame
         24.728s dev-mapper-centosx2droot.device
         15.135s kdump.service
         14.670s plymouth-quit-wait.service
         14.210s firewalld.service
          9.835s accounts-daemon.service
          7.383s ModemManager.service
          7.259s libvirtd.service
          7.257s systemd-logind.service
          7.177s ksm.service
          7.081s gssproxy.service
          7.067s avahi-daemon.service
          7.062s rsyslog.service
          7.039s abrt-ccpp.service

As you see the output is sorted according to the time taken by each unit, you can easily find out which service is taking more time during booting and can dig down deeper to analyze the issue.

At certain steps, the boot cannot proceed until all dependencies for unit are satisfied. To see units at these critical points run systemd-analyze critical-chain.

# systemd-analyze critical-chain
The time after the unit is active or started is printed after the "@" character.
The time the unit takes to start is printed after the "+" character.

graphical.target @1min 2.102s
└─multi-user.target @1min 2.102s
  └─abrt-vmcore.service @1min 1.228s +872ms
    └─kdump.service @46.090s +15.135s
      └─remote-fs.target @46.086s
        └─remote-fs-pre.target @46.083s
          └─iscsi-shutdown.service @45.951s +99ms
            └─network.target @45.944s
              └─network.service @44.959s +975ms
                └─NetworkManager.service @38.653s +689ms
                  └─firewalld.service @24.439s +14.210s
                    └─basic.target @23.850s
                      └─sockets.target @23.849s
                        └─cups.socket @23.847s
                          └─sysinit.target @23.618s
                            └─systemd-update-utmp.service @23.603s +13ms
                              └─auditd.service @22.959s +643ms
                                └─systemd-tmpfiles-setup.service @22.726s +230ms
                                  └─rhel-import-state.service @22.431s +294ms
                                    └─local-fs.target @22.428s
                                      └─boot.mount @19.675s +2.126s
                                        └─dev-disk-byx2duuid-7de2053cx2d44d7x2d4f33x2db522x2d81dee2f6b69b.device @19.652s

SVG graphic image can be plot which contains detailing about system services start time, highlighting the time they spent on initialization. Make sure you have enabled graphical display mode or have x-windows enabled in order to see the plot.

# systemd-analyze plot > plot.svg
# eog plot.svg

Here is a snip from sample plot on my CentOS 7 machine. Zoom in to check the waterfall clearly.

systemd-analyze plot

Filed Under: CentOS/RHEL 7, Linux

Some more articles you might also be interested in …

  1. CentOS / RHEL 6 : How to disable telnet service
  2. How to set children-max for udev Service in CentOS/RHEL 7
  3. What’s the difference between locate and find command in Linux
  4. How To Create/Remove and Mount a Stratis Filesystem in CentOS/RHEL 8
  5. CentOS / RHEL 7 : How to configure Network Bonding or NIC teaming
  6. CentOS / RHEL : How to install a specific version of rpm package using YUM
  7. “sudo: /etc/sudoers is world writable” – How to correct the permissions of sudoers file
  8. CentOS / RHEL 7 : How to change runlevels (targets) with systemd
  9. CentOS / RHEL 7 : How to modify Network Interface names
  10. How to Customize Linux Password Expiration and Complexity Requirements

You May Also Like

Primary Sidebar

Recent Posts

  • How to Disable IPv6 on Ubuntu 18.04 Bionic Beaver Linux
  • How to Capture More Logs in /var/log/dmesg for CentOS/RHEL
  • Unable to Start RDMA Services on CentOS/RHEL 7
  • How to rename a KVM VM with virsh
  • Archives
  • Contact Us
  • Copyright

© 2021 · The Geek Diary