Hi all.
“Inspired” by another question I started to analyze what processes or events “consume” boot up time.
But I found a nuisance: there’s no consistency between different start-ups, so optimization will come from two points: to remove unnecessary modules or programs, and to determine why, sometimes, there are so many variations for the same process.
I explained a little more:
On Wednesday I boot up my machine at morning. It was a “cold” start-up. This is what I got:
$ systemd-analyze time
Startup finished in 2.611s (kernel) + 3.387s (initrd) + 36.198s (userspace) = 42.197s
Today I made another cold start-up:
$ systemd-analyze time
Startup finished in 2.613s (kernel) + 3.537s (initrd) + 32.722s (userspace) = 38.872s
Well, 3.3 seconds difference, about 8%. And there are almost no differences in kernel time and initrd time. All came from “userspace”.
A note: my box has a Intel i5 at 3.1 GHz, with 4 GB of RAM and 2 hard disks with A LOT of partitions. I don’t know if the 5 seconds dedicated to kernel and initrd are too much or not. Comparing with the whole 40 seconds to boot, I don’t care yet about optimizing kernel and initrd.
Analyzing “individual” boot times, I have got on Wednesday:
$ systemd-analyze blame | head -15
19.999s dkms.service
13.320s ModemManager.service
12.964s firewalld.service
11.303s systemd-logind.service
11.285s avahi-daemon.service
11.283s rtkit-daemon.service
11.283s upower.service
11.282s udisksd.service
7.670s NetworkManager-wait-online.service
5.979s nmb.service
4.859s network-up.service
2.452s plymouth-quit-wait.service
2.383s systemd-udev-settle.service
2.223s chronyd.service
1.934s systemd-fsck-root.service
And today:
$ systemd-analyze blame | head -15
16.881s dkms.service
8.322s ModemManager.service
7.944s NetworkManager-wait-online.service
6.995s firewalld.service
6.534s systemd-logind.service
6.534s avahi-daemon.service
6.532s rtkit-daemon.service
6.532s upower.service
6.531s udisksd.service
6.194s nmb.service
4.223s plymouth-quit-wait.service
4.093s network-up.service
2.549s systemd-udev-settle.service
2.501s network.service
2.430s rpcbind.service
Well…
dkms.service eats up a lot of time. Always. I don’t know if it’s always needed. I understand that I need it if I must update the nvidia driver for example, or the kernel. But, is it always needed?
Some processes vary their boot time a lot, but they always “stay together” (so I guess that some of them influences in others at the time of boot). In my case, systemd-logind.service, avahi-daemon.service, rtkit-daemon.service, upower.service and udisksd.service last almost the same in both cases, even when they are VERY different between boots, almost 45% of difference !! WHY ??
That difference can reach extreme limits. gpm.service lasted 1.804 seconds on Wednesday, and 0.317 seconds today. A 6x factor. But the champions are:
fedora-loadmodules.service: 1.805 s vs. 0.047 s
alsa-restore.service: 1.815 s vs. 0.063 s
Maybe another case of “stay together”? I don’t know, but if so, something happens with fedora-loadmodules.service. Anyway, there’s a 38x factor for fedora service and a 29x factor for alsa. It’s a way too much !
My questions:
1- Why I get so different times with some services?
2- Can those differences be “controled” or optimized in some way?
3- I use a router to my local network. The router is connected to a cablemodem to get Internet. I’m not directly connected to the cablemodem, except in very rare and specific situations (always related to my ISP). Do I need the “ModemManager.service”?
4- Can network times (NetworkManager and network services) be optimized if I don’t use DHCP and force a fixed IP in my network? I guess that’s a point to be easily optimized. I’ll try in some next boot.