Slow boot - reason unknown

I have a system with many distros on it - several of them Arch based. Most of them boot quite quickly, ~5 seconds from selection at the boot loader screen. One, however, takes 50-55 seconds from the same point. I would prefer to figure out why, and perhaps eliminate the delay!

What I hope I can get is some direction to aim my searches, as I learn more than I ever thought to know (or want to!) about starting up a system. Here is a systemd-analyze blame which raises some possibilities:

systemd-analyze blame

┌11:04:56 WD= [/usr/share/conkywx]
└───freebird@nest ─:arrow_forward:$ systemd-analyze blame
48.037s systemd-swap.service
46.689s man-db.service
46.314s NetworkManager-wait-online.service
45.281s user@965.service
1.127s evdev-rce.service
763ms lvm2-monitor.service

Somewhat truncated, as I doubt any items further down are the source of the slowdown - but I would appreciate any pointers as to which to research first! One of possibilities is Network-Manager wait-online.service - but I’m running hardwired which my limited experience suggests should not be a slowdown.

Thanks for any directions to turn my attention to…

If you use systemd-analyze critical-chain it will tell you which services are affecting the final boot time rather than just those which are running the longest.

However, given

it’s possible that you’re running with an HDD and so the man page database regeneration is having an impact on overall IO.

2 Likes

On some systems does slowdown Arch (although not that hard as 55 seconds)
@antechdesigns had tweaked them before, if i remember correctly, he might help

That usually one-time operation though?
I mean, not every boot

1 Like

I’m mostly on a gen 4 nvme drive, and only have a spinner for data storage - and apart from mounting it in fstab, it shouldn’t be referenced. I’ll try the other investigation now.

1 Like

https://bbs.archlinux.org/viewtopic.php?id=244699

See that, something tells me it’s lvm2 again

Setting lvmetad = 0 solves the problem.

Quick test to see if it fixes problem :wink:
Well, unless you use it.

1 Like

Well- I can’t say as I understand the contents entirely, but it doesn’t appear that lvmetad takes long…

critical-chain

15:18:27 WD= [~]
└───freebird@nest ─:arrow_forward:$ systemd-analyze critical-chain
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.

graphical.target @49.416s
└─multi-user.target @49.415s
└─systemd-swap.service @1.580s +47.835s
└─basic.target @1.551s
└─sockets.target @1.550s
└─snapd.socket @1.542s +5ms
└─sysinit.target @1.516s
└─systemd-timesyncd.service @1.324s +191ms
└─systemd-tmpfiles-setup.service @1.304s +15ms
└─local-fs.target @1.300s
└─run-user-965.mount @3.114s
└─local-fs-pre.target @1.030s
└─lvm2-monitor.service @162ms +868ms
└─lvm2-lvmetad.service @396ms
└─systemd-udevd.service @192ms +203ms
└─systemd-tmpfiles-setup-dev.service @181ms +8ms
└─kmod-static-nodes.service @161ms +5ms
└─systemd-journald.socket @158ms
└─-.mount @148ms
└─system.slice @148ms
└─-.slice @148ms

lvm is not in use. What is strange to me is all the other systems are Arch-based too (EndeavourOS, Arch, Arcolinux). Of course, if it wasn’t strange I would already know how to fix it :grin:

This is adding 47 seconds to the boot time, so this is where the issue lies.

3 Likes

Makes sense - so I guess I’ll go read up on what it is, and what to change. Thanks!

1 Like

Yeah but that’s the point - it can act voodoo and not really be seen on systemd-analyze as an effect (well not always), if i remember correctly…but hopefully not :sweat_smile:

For example it can slowdown systemd-swap as a side effect etc…
lvm2 is really weird on some specific systems :ghost:
So just to exclude i’d still recommend to try…Even if as last measure :slight_smile:

Any reason I shouldn’t just remove (uninstall) systemd-swap? I have lots of physical swap space (unused anyway) and from what I’ve read so far it’s for handling alternative swap methods…

Well, you better ask @jonathon as he’s usually a swap proponent and can give good argument :slight_smile:

I don’t use swap even with 8 Gb of RAM :stuck_out_tongue_winking_eye:
So if you ask me i’d kill it.

I quite like having it available - and I also like not ever needing it! But a physical swap partition, mounted in fstab, should be enough I would expect. I am guessing this was added for performance reasons (zswap?) but with consequences :grin:

1 Like

If you don’t want a physical swap partition or file, for just-in-case maybe a little of zram might be a good idea, if the system ever needs to swap.

I don’t push my 32Gb all that often to experience an improvement! I wonder why it’s so slow though - maybe some configuration issue? More reading…

1 Like

Yes I turn off all services I don’t need, lvm2 is one of them, it doesn’t slow down boot per say, just one less service to load. Same with:

  • man-db.service

  • NetworkManager-wait-online.service

Don’t use swap but if I did it would be a swapfile

Also why have you got user@965.service on every arch install I have ever done it has always been user@1000.service not sure if that’s an issue?

I’d also recommend checkin your journal for any other hardware issues:
journalctl -p 3 -xb

Post it here if you like I will take a look, assuming any problems.

2 Likes

I don’t think there are any problems - but I need to research the performance tweaks that has systemd-swap as a dependency. If it needs removing, and is not in fact giving performance elsewhere!

Thanks to all for the help - I know more now - which was the object of the exercise!

1 Like

Why don’t you use a swap file instead of a swap partition?

Because I don’t need either, mainly - and a partition set up once, and used by all the different distros does not actually waste many resources needlessly. A swap file, on the other hand, would need to be set up on each system and would require me to be less lazy! :grin:

1 Like

Oh no, not that!! :rofl:

I wasn’t thinking of that? Not all the distro’s but the —less lazy! :rofl:

1 Like