[gentoo-user] Pointers on how to speed up the boot process with systemd
Greetings fellow Gentooistas, I am looking for input on how to speed up my boot process with systemd on Gentoo. First of one word to systemd: Gentoo is about choice, and I choose to take a deeper look into systemd out of curiosity, so please respect that and don't turn it into another kind of OpenRC vs. systemd debate. Thanks in advance. Having said that, now to my setup: I am running the vanilla kernel 3.13.6 with only the necessary drivers builtin to the kernel, almost nothing as module. Features I don't need are disabled. Readahead-Services are disabled. Since my root partition is XFS, fsckd is disabled. systemd-analyze says: Startup finished in 584542y 2w 2d 20h 1min 35.953s (loader) + 1.477s (kernel) + 15.966s (userspace) = 17.444s Blame says: 1min 7.815s systemd-tmpfiles-clean.service 4.900s NetworkManager.service 3.214s systemd-logind.service 2.585s lightdm.service 2.373s systemd-vconsole-setup.service 1.506s systemd-update-utmp.service 919ms upower.service 697ms polkit.service 387ms systemd-udev-trigger.service 381ms systemd-sysctl.service 374ms tmp.mount 359ms udisks2.service 334ms kmod-static-nodes.service 333ms user@0.service 332ms systemd-user-sessions.service 299ms systemd-tmpfiles-setup-dev.service 288ms sys-fs-fuse-connections.mount 287ms systemd-remount-fs.service 228ms systemd-tmpfiles-setup.service 178ms systemd-random-seed.service 117ms systemd-fsck-root.service 103ms systemd-journal-flush.service 71ms wpa_supplicant.service 65ms accounts-daemon.service 51ms user@1000.service 35ms systemd-udevd.service 22ms alsa-restore.service Critical Chain says: 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 @15.965s └─multi-user.target @15.965s └─NetworkManager.service @11.065s +4.900s └─basic.target @11.065s └─timers.target @11.064s └─systemd-tmpfiles-clean.timer @11.043s └─sysinit.target @4.264s └─systemd-vconsole-setup.service @1.891s +2.373s └─systemd-journald.socket @1.572s └─-.mount @1.571s └─system.slice @1.947s └─-.slice @1.947s Boot disk is a normal HDD SATA. GDM-Replacement is lightdm. So i wonder what could I do to speedup the boot process any further? Thanks in advance.
Re: [gentoo-user] Pointers on how to speed up the boot process with systemd
On Sun, Mar 9, 2014 at 10:47 AM, Marc Stürmer m...@marc-stuermer.de wrote: Greetings fellow Gentooistas, Hi Marc. I am looking for input on how to speed up my boot process with systemd on Gentoo. First of one word to systemd: Gentoo is about choice, and I choose to take a deeper look into systemd out of curiosity, so please respect that and don't turn it into another kind of OpenRC vs. systemd debate. Thanks in advance. Having said that, now to my setup: I am running the vanilla kernel 3.13.6 with only the necessary drivers builtin to the kernel, almost nothing as module. I'm not sure if running with the drivers built-in speed up things. Features I don't need are disabled. OK. Readahead-Services are disabled. Since my root partition is XFS, fsckd is disabled. OK. systemd-analyze says: Startup finished in 584542y 2w 2d 20h 1min 35.953s (loader) + 1.477s (kernel) + 15.966s (userspace) = 17.444s Something is wrong here; unless you are booting a 386 machine, there is no way it should take a minute and a half to boot. And even with a 386 I would be suspicious. Blame says: 1min 7.815s systemd-tmpfiles-clean.service 4.900s NetworkManager.service 3.214s systemd-logind.service 2.585s lightdm.service 2.373s systemd-vconsole-setup.service 1.506s systemd-update-utmp.service 919ms upower.service 697ms polkit.service 387ms systemd-udev-trigger.service 381ms systemd-sysctl.service 374ms tmp.mount 359ms udisks2.service 334ms kmod-static-nodes.service 333ms user@0.service 332ms systemd-user-sessions.service 299ms systemd-tmpfiles-setup-dev.service 288ms sys-fs-fuse-connections.mount 287ms systemd-remount-fs.service 228ms systemd-tmpfiles-setup.service 178ms systemd-random-seed.service 117ms systemd-fsck-root.service 103ms systemd-journal-flush.service 71ms wpa_supplicant.service 65ms accounts-daemon.service 51ms user@1000.service 35ms systemd-udevd.service 22ms alsa-restore.service Something is seriously wrong with systemd-tmpfiles-clean.service; why it takes 1:07 minutes to run? Do you have /tmp as a tmpfs? Critical Chain says: 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 @15.965s └─multi-user.target @15.965s └─NetworkManager.service @11.065s +4.900s └─basic.target @11.065s └─timers.target @11.064s └─systemd-tmpfiles-clean.timer @11.043s └─sysinit.target @4.264s └─systemd-vconsole-setup.service @1.891s +2.373s └─systemd-journald.socket @1.572s └─-.mount @1.571s └─system.slice @1.947s └─-.slice @1.947s Could you run systemd-analyze critical-chain systemd-tmpfiles-clean.service? Boot disk is a normal HDD SATA. When I used a HDD, my boot times where around 30 seconds. With a SDD now is around 12; it *makes* a big difference. I highly recommend it; I use a smallish 64GB drive for basically just the root filesystem. GDM-Replacement is lightdm. Normal GNOME (including GDM) here. So i wonder what could I do to speedup the boot process any further? In your critical-chain systemd-tmpfiles-clean.service was not included (only systemd-tmpfiles-clean.timer). From blame, I think that's the obvious offender. Again, do you have /tmp as a tmpfs? What do you have in /etc/tmpfiles.d? Just for comparison, my system: centurion ~ # systemd-analyze Startup finished in 1.469s (kernel) + 11.005s (userspace) = 12.474s centurion ~ # systemd-analyze blame 8.944s NetworkManager-wait-online.service 195ms systemd-fsck@dev-disk-by\x2dlabel-Files.service 167ms NetworkManager.service 146ms ModemManager.service 112ms systemd-fsck@dev-disk-by\x2dlabel-Data.service 104ms polkit.service 92ms systemd-vconsole-setup.service 82ms files.mount 75ms udisks2.service 68ms systemd-udev-trigger.service 61ms colord.service 49ms systemd-journal-flush.service 46ms kmod-static-nodes.service 46ms home-canek-Music.mount 42ms systemd-fsck-root.service 42ms systemd-logind.service 40ms systemd-tmpfiles-setup.service 40ms systemd-hostnamed.service 40ms gdm.service 35ms proc-sys-fs-binfmt_misc.mount 35ms sys-kernel-debug.mount 35ms systemd-readahead-replay.service 35ms avahi-daemon.service 34ms systemd-readahead-collect.service 34ms dev-hugepages.mount 34ms dev-mqueue.mount
Re: [gentoo-user] Pointers on how to speed up the boot process with systemd
Am 09.03.2014 18:39, schrieb Canek Peláez Valdés: Something is wrong here; unless you are booting a 386 machine, there is no way it should take a minute and a half to boot. And even with a 386 I would be suspicious. No, actually it is an Intel i5-4670K with 8 GB of RAM. Something is seriously wrong with systemd-tmpfiles-clean.service; why it takes 1:07 minutes to run? Do you have /tmp as a tmpfs? Yes, at least according to mount, it is. mount | grep tmpfs devtmpfs on /dev type devtmpfs (rw,relatime,size=238864k,nr_inodes=59716,mode=755) tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev) tmpfs on /run type tmpfs (rw,nosuid,nodev,mode=755) tmpfs on /sys/fs/cgroup type tmpfs (rw,nosuid,nodev,noexec,mode=755) tmpfs on /tmp type tmpfs (rw) By the way my actual blame does tell: systemd-analyze blame 6.087s NetworkManager.service 5.310s alsa-restore.service 4.226s systemd-logind.service 3.660s lightdm.service 2.581s systemd-vconsole-setup.service 688ms polkit.service 479ms systemd-user-sessions.service 413ms kmod-static-nodes.service 381ms systemd-udev-trigger.service 358ms user@0.service 352ms systemd-tmpfiles-setup-dev.service 274ms tmp.mount 265ms systemd-journal-flush.service 246ms systemd-sysctl.service 235ms systemd-random-seed.service 205ms upower.service 205ms udisks2.service 197ms systemd-udevd.service 195ms systemd-tmpfiles-setup.service 183ms systemd-fsck-root.service 163ms systemd-remount-fs.service 126ms systemd-update-utmp.service 125ms sys-fs-fuse-connections.mount 53ms wpa_supplicant.service 50ms user@1000.service 50ms accounts-daemon.service Actual systemd-analyze: Startup finished in 584542y 2w 2d 20h 1min 42.032s (loader) + 1.540s (kernel) + 11.028s (userspace) = 12.569s Actual critical chain: graphical.target @11.028s └─multi-user.target @11.028s └─NetworkManager.service @4.940s +6.087s └─basic.target @4.939s └─timers.target @4.721s └─systemd-tmpfiles-clean.timer @4.721s └─sysinit.target @4.489s └─systemd-vconsole-setup.service @1.907s +2.581s └─systemd-journald.socket @1.660s └─-.mount @1.660s └─system.slice @2.030s └─-.slice @2.030s Could you run systemd-analyze critical-chain systemd-tmpfiles-clean.service? Sure, here it is: └─systemd-tmpfiles-clean.timer @4.721s └─sysinit.target @4.489s └─systemd-vconsole-setup.service @1.907s +2.581s └─systemd-journald.socket @1.660s └─-.mount @1.660s └─system.slice @2.030s └─-.slice @2.030s In your critical-chain systemd-tmpfiles-clean.service was not included (only systemd-tmpfiles-clean.timer). From blame, I think that's the obvious offender. Again, do you have /tmp as a tmpfs? What do you have in /etc/tmpfiles.d? /etc/tmpfiles.d is empty. Notice that systemd-tmpfiles-clean.service takes almost no time; here it's its critical chain: Yes, I see, so makes me wonder. BTW, my fstab: /dev/sda1 /boot ext2noauto,noatime 0 0 /dev/sda2 / xfs noatime,nodiratime 0 0 Thanks.
Re: [gentoo-user] Pointers on how to speed up the boot process with systemd
On Sun, Mar 9, 2014 at 11:47 AM, Marc Stürmer m...@marc-stuermer.de wrote: [snip blame] Actual systemd-analyze: Startup finished in 584542y 2w 2d 20h 1min 42.032s (loader) + 1.540s (kernel) + 11.028s (userspace) = 12.569s OK, this is actually normal. Do you realize that it's completely different from the first one you posted? Getting less than 12 seconds will be difficult, specially on a rotating hard drive. Maybe when gnome-session (if you use GNOME) starts using systemd --user, then we will be able to go from power up to desktop in less than 10 seconds. With this new set of measurements, I don't see anything (obvious) that you can speed up. Next step would be to get a SDD, I guess. Regards. -- Canek Peláez Valdés Posgrado en Ciencia e Ingeniería de la Computación Universidad Nacional Autónoma de México
Re: [gentoo-user] Pointers on how to speed up the boot process with systemd
Am 09.03.2014 18:56, schrieb Canek Peláez Valdés: OK, this is actually normal. Do you realize that it's completely different from the first one you posted? Yes, I do though I still wonder what changed, but I do not complain. Getting less than 12 seconds will be difficult, specially on a rotating hard drive. Maybe when gnome-session (if you use GNOME) Good. Well, I am not using GNOME 3.X at all, since this peace of sh*t is just an unusable mess for me. I am using MATE and I am quite content with it. Thanks again.