I'm customizing a Raspbian Stretch Lite image to fit my needs. I'm quite fine with the results but now I would like to speed up the booting process because it takes so long to complete.
Here some outputs:
$ systemd-analyze
Startup finished in 1.653s (kernel) + 1min 31.345s (userspace) = 1min 32.999s
-
$ 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.
multi-user.target @1min 31.250s
└─getty.target @11.659s
└─[email protected] @11.658s
└─rc-local.service @8.212s +80ms
└─network-online.target @8.196s
└─network.target @8.165s
└─networking.service @3.291s +4.871s
└─local-fs.target @3.249s
└─run-user-1000.mount @16.903s
└─local-fs-pre.target @1.907s
└─keyboard-setup.service @1.062s +843ms
└─systemd-journald.socket @1.057s
└─-.mount @872ms
└─system.slice @1.022s
└─-.slice @872ms
-
$ systemd-analyze blame
4.871s networking.service
4.634s dhcpcd.service
4.551s busybox-syslogd.service
4.393s raspi-config.service
3.304s plymouth-quit-wait.service
3.289s plymouth-quit.service
1.999s dev-mmcblk0p2.device
1.883s nmbd.service
1.336s lighttpd.service
972ms smbd.service
843ms keyboard-setup.service
738ms systemd-logind.service
685ms ssh.service
...
As far as I understand the networking applications take over 14 seconds (networking.service, dhcpcd.service, nmbd.service, smbd.service, lighttpd.service, ssh.service).
Questions:
- about the networking applications, do you think the delays are acceptable or there is a way to improve them?
- what does the raspi-config service do? It says "switch to ondemand cpu governor". Might I safely disable it?
- why the playmouth service take over 6 seconds to quit? Is it normal?
UPDATE
As pointed out in the comments, I cannot rely on an always-powered solution. For several reasons the Raspberry Pi is turned on and off physically (connecting and detaching the power supply) and this behavior cannot be changed. I could agree there might are better ways but this is a project constraint and I'm just focusing on how to reduce the boot time.