Skip to content

Instantly share code, notes, and snippets.

@holmanb
Created April 6, 2023 22:10
Show Gist options
  • Save holmanb/50612ba4e506b68745bd32e04193a145 to your computer and use it in GitHub Desktop.
Save holmanb/50612ba4e506b68745bd32e04193a145 to your computer and use it in GitHub Desktop.
ubuntu@ubuntu:~$ systemd-analyze critical-chain cloud-init-local.service
The time when unit became active or started is printed after the "@" character.
The time the unit took to start is printed after the "+" character.
cloud-init-local.service +1min 27.432s
└─systemd-remount-fs.service @35.183s +1.631s
└─systemd-fsck-root.service @29.899s +3.711s
└─systemd-journald.socket @26.502s
└─system.slice @26.076s
└─-.slice @26.073s
ubuntu@ubuntu:~$ systemd-analyze blame
3min 35.206s snapd.seeded.service
1min 27.432s cloud-init-local.service
49.577s dev-vda1.device
48.939s cloud-init.service
36.818s snapd.service
34.327s apport.service
30.878s pollinate.service
26.549s cloud-config.service
22.788s rsyslog.service
20.467s cloud-final.service
20.259s systemd-udev-trigger.service
16.607s systemd-resolved.service
14.968s snap.lxd.activate.service
12.838s dev-loop0.device
12.520s dev-loop1.device
11.969s keyboard-setup.service
11.863s dev-loop2.device
11.539s snapd.apparmor.service
10.061s systemd-logind.service
9.491s apparmor.service
8.947s systemd-timesyncd.service
7.936s update-notifier-download.service
6.360s multipathd.service
Long Calls (manual analysis):
-----------------------------
12s - netplan generate
6s - blkid
<6s - loading & parsing yaml
1s - closing stdin (or whatever comes after that that is not logged)
.5s - mount
.5s - umount
The question is:
Why does cloud-init think it only took 40s, but systemd thinks it took 1m 30s?
2023-04-06 19:10:59,215 - util.py[DEBUG]: cloud-init mode 'init' took 40.976 seconds (40.96)
2023-04-06 19:10:59,219 - handlers.py[DEBUG]: finish: init-local: SUCCESS: searching for local datasources
2023-04-06 19:11:17,505 - util.py[DEBUG]: Cloud-init v. 23.1.1-0ubuntu2 running 'init' at Thu, 06 Apr 2023 19:11:16 +0000. Up 228.80 seconds.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment