379 points · by orhunp_ · 3w ago · 154 comments
(Honestly, it spends more time in uefi preboot than it does to actually boot the system.)
DDR5 training is a huge (UX) issues wrt. boot times (mainly on desktop systems).
sure only "once" if your system is correctly setup, but I have seen too many cases of buggy motherboards not properly handling this
and the biggest issue is the transparency, i.e. you don't see that it does DDR5 "training"/"parameter self adaption". It looks like it's "just stuck" in early EFI.
Also the soldered ram couldn't have changed from last boot, so reuse the last training? That's exactly what I mean.
except this should only happen _once_ (until you remove/replace components, reset the BIOS etc.). Which is why it normally doesn't happen for laptops, it was run once in the factory and DDR being soldered one mean they can just "fixed" disable the retraining avoiding bugs in the "retraining needed" detection
but yes, there are pretty bad motherboards out there, like the one I have turned out to be a complete shit show with multiple sever design issues I unluckily "lucked out of not running into" in the first 2 years of usage making a return unlikely and a replacement is useless as this is are fundamental issue affecting all models AFIK.
> it took them 12 seconds from initrd to fully loaded
Looks like they intentionally slow it down. Look at service names > my laptop boots so fast, those 12 seconds are like two seconds
From cold boot or warm? Fwiw my desktop warm boots fast enough that I don't see anything. Cold boots in about 5s and I guarantee I have more devices to mount than your laptop does.If you want fast boots with systemd you usually have to do a little tuning (nothing serious unless you want to go sub 2s cold boot). Some things could probably be automated but it is understandable why they are not. For example, do you wait for a disk to mount, how many retries, how long before timeout, or do you lazy load? In a laptop it's easier to make a decision. But if you don't know if the machine is a laptop, a desktop, or a server, then what is the best default choice? I'd agree that the safe choice is best
Though if it suddenly starts taking a lot longer, perhaps this sort of display could help in finding a clue as to why?
What i don't get is why booting still takes seconds. When power is on, the hardware is on.
You can initalize most hardware in parallel, reading the amount of operation system into ram is fast.
For me, it's decrypting the FDE partition (Grub has a slower encryption routine than cryptsetup, which determines round number on "how many rounds can we do in X seconds"), followed by Linux decrypting the swap partition (takes 2 whole seconds) followed by NetworkManager waiting several seconds to discover networks before resuming boot services.
With the right setup, you can boot Linux in (dozens of) milliseconds. You'll have to throw out all subsystems you don't need, compile and configure all drivers you do need, and preferably skip the initramfs step. Doable, but not very practical, because you'll need to recompile the kernel for every update or boot reconfiguration.
but also no reason to not render the tree with proper graphics, TUI is an UI just like GUI is and living dags are particularly well suited to be animated.
Doing full graphics is probably a nice touch on virtual machines and some well-supported hardware, but I prefer safe defaults for early boot.
It's perfectly fine for the system's essentials to be non-fancy, to ensure they will also work under adverse conditions.
watch -c SYSTEMD_COLORS=1 SYSTEMD_URLIFY=0 systemctl status
if you want to keep the rainbow experienceI would love to understand the process of coming up with the UX design is, what the principles are, and where the understanding of what "good" looks like, comes from.
Meanwhile, on systems where I don’t use systemd, the entire initialization process can be displayed in about 30 lines on the screen - and I don’t have to wade through a chaotic web of dependencies, some of which are even auto-generated. As far as I can tell, I currently have about 350 of them active.
Boot times were supposed to be fast, too - yet, curiously enough, systemd often ends up saying, "waiting 1m30s for..."
wouldn't that be the fault of the service it's waiting for and not systemd itself?
On one side, you have shell scripts that are generally pretty simple (FreeBSD’s init is something like 1000-2000 LOC for the implementation, and a simple service script is tens of lines).
On the other side, you have a monolith that hit 1.3 million lines of code a few years ago, and has gotten more and more complicated since then.
Assuming the waits are not a bug, then they are a misconfiguration. When I gave up on using it, the manual was long, incomprehensible, and the small documented fraction of systemd’s behavior didn’t match the manual.
Just a nit, that 1.3 million lines was reported incorrectly. You can see some talk at https://news.ycombinator.com/item?id=21935186 and I remember a Poettering tweet saying that was including things like documentation. At the time systemd was under 500k lines; still big but not quite so huge.
I'm also not sure if that count was for the full repository (which contains multiple modular projects like systemd-resolved that are not required for systemd) or just the actual systemd bin.
systemd suffers from the lack of systemic design, but it's still way better than the pile of scripts that it replaced.
Yep. For me, it's most often a 90 second delay that comes from the combination of the automagical conversion of fstab entries into services, an NFS mount in fstab, and an offline NFS server.
Sane init systems notice that this is a networked filesystem (I've even marked it with the _netdev option!) and don't hang the boot for a minute and a half screaming at a dead server. Systemd is anything but sane.
You're probably thinking of OpenRC. It's quite nice and remains the distro's default init system.
To be honest, from very beginning I viewed both (upstart and systemd) as dead-ends. Dependencies? Meh, rcorder in NetBSD has local dependencies years ago and, for larger installations, local-only dependency system has no value - because my app needs mysql... on another server. And modern init and supervision suite (systemd) without concept of inter-network dependecy? Meh. Like... let me think... a project of modern desktop without concept of remote work in eve of remote work explosion and covid times too - or something like that.
Supervising? I already had daemontools, monit, runit and whatever else (not mentioning s6) - even nowadays I really don't see cases, when systemd is used to restart services automatically.
Sure your web server "started" 5 seconds after boot, in that a PID now exists for it, but that doesn't mean it will serve a web request if dhcp hasn't finished yet. `/etc/init.d/nginx status` tells lies on those old systems.
> retry loops when a server starts in case binding the socket fails, or if a configured network interface/directory doesn't exist
FYI, you can change all of that pretty easily.I think the issue is systemd takes the stance of the "safe" route first, which is not really necessary for most personal machines and not the greatest when people are using mostly flash. But a 90s timeout makes sense if you are loading a 20TB hdd (I've even seen longer load times on much smaller drives)
> Boot times were supposed to be fast, too - yet, curiously enough, systemd often ends up saying, "waiting 1m30s for..."
I'd wager that that's your disk drive being slow to boot.Either lazy load that drive or change to faster media like a ssd or nvme.
My guess is because that's the default timeout for disks
Stuff the same amount of functionality into whatever 2000s style boot mechanism you use, and you'll be waiting just as long (you'll just need to make your you add ample `sleep` calls to make sure the network is up before your web server can bind, or accept that your system boots up flaky perhaps).
It may terrify windows and osx refugees, but that's a sacrifice I am happy to make ;)
Doesn't have to be like this, either. On my Void Linux system boot happens faster than the TV takes to turn on. Still more than zero point four seconds, though.
On which system? Is your machine, for whatever reason, re-doing "memory training" everytime it boots? This is one can be really slow.
Why?
I was attracted to Linux because unlike Windows or macOS, I actually have choice with Linux. I can choose my filesystem, my libc, my init system, my bootloader, my system encryption, my window manager, etc.
Sure, it's not perfect: many programs assume that you have glibc, or dbus, or X11, or wayland, etc. Actually many programs assume that you run Ubuntu. And it is frustrating when you would want to use a program and can't because of such an assumption. But again on Linux, there is (or used to be?) a big open source culture. This program is assuming glibc? I can patch it to work with musl. Etc.
Systemd, to me, sounds like it says: "why would I care about interoperability? I am the best, you should use me. And if you want something else, you should make that something else interoperable with me, because I make the rules". It's not like systemd is trying to standardise stuff to allow alternative components to exist, right? It doesn't actively try to prevent alternatives, but that's pretty much it.
And normally I wouldn't care (again, Linux is about freedom of choice for me). But systemd being as successful as it is dramatically reduces my freedom. And systemd it seemingly trying to take over more and more components. And the more adoption it gets, the more power it has. You didn't want systemd to replace that part of your system? Too bad, it will. What are you gonna do anyway, systemd is too big to care about you at this point.
Throwing X11 and Wayland into your post makes me suspect you don't actually know what you want and you will always find something to be unhappy about.
Wayland tried its best to be a protocol that lets people implement their own compositor from scratch. But then the compositor developers didn't like the fact that they had too much freedom so they begged the Wayland developers to make it more like X11, a single monolithic code base. The Wayland developers refused and then begrudgingly accepted more responsibilities for things that are and should not be the responsibility of Wayland.
I just don't see why anyone should care about people self sabotaging themselves like you. You'll be unhappy no matter what anyone does for you.
- Too many parts.
- Doing too many things, sometimes poorly.
- Fights with other services, no graceful fallback & logging (i.e. aggressive).
- As a result, unnecessarily complex, brittle and fragile.
- Harder to secure (at code level) than simpler tools.
- Project is too aggressive and want to replace any and every service.
- Sometimes break in unexpected ways.
- Not faster than Parallel Sys-V.
We can discuss these. I'm not the one who wants flame wars.I can remember having to deal with SysVinit and thank god for Poettering and all the other systemd maintainers for bringing the Linux ecosystem to the 21st century
But do you run systemd and complain or why do you even hate it?
its linux right, if a linux distribution decides to use it, its not systemds fault to be used and if you use it and don't take the time and effort to have it your way, you shouldn't complain either?
The thing with the whole systemd hate thing is everyone now knows why people might hate systemd (I am not a fan). I think a lot of features around isolation and systemd containers where useful but now probably using your containerization system that best suits your needs.
For me when I get really mad at it is when I want to build small nixos Images and want to minimize the footprint of systemd and run few services (some of that is on nixos as well).
I think it's better suited for desktop systems then server systems and it's quite annoying how prevalent it is. D-bus is one thing that always annoys me and how everything in systemd wants to use it and you can run into issues disabling it (Also don't like D-bus even on a desktop system).
Overall I think and hope we will see a rise not necessarily in openrc but in simpler init 1 systems that try to do less and provide good strong primitives that allow for easily using what ever daemon configured how you want, rather then trying to provide coupled implementations for everything.
Again I know these criticism are something of a meme, but they still are true.
systemd (or rather Poettering) also isn't really a fan of dbus. That is why most new IPC APIs are using Varlink (and socket activation) instead of dbus. They've also been slowly migrating some of the internal IPC calls to Varlink instead.
Systemd probably is never getting rid of the dependency of dbus due to providing public APIs via it, but maybe it can be downgraded at some point to an optional dependency where APIs are registered if it is installed and just skipped if not.
In the resolver, in the ntp service, in the logging system, pretty much every part has had them and they keep coming. Largely because they introduce complexity that most do not understand. Some unfortunate decisions have not been recitified until the original developer lost interest and their heir had to make a heroic effort in figuring out the code.
Let's also not forget that the only time in history a major Linux distribution was backdoored, was only because some openssh package maintainers felt the need to link sshd to libsystemd. This was obviously not directly the fault of systemd maintainers but the culture around it absolutely contributed.
Only Rube-Goldberg complexity on the scale of systemd made the XZ backdoor possible. Systemd was made by despicable individuals who went on to work for despicable companies (as a big fuck you to open-source lovers) and then later on to work on even more despicable surveillance project (as a big fuck you to humanity).
systemd has its tentacles meddling in every single part of the Linux ecosystem.
But thankfully there's light at the end of the tunnel: thanks to VMs and containers and the need for speed, we've seen many minimal distros (I'm thinking stuff like Talos for Kubernetes) and those of course don't use systemd.
As soon as I get the time to switch away from my current hypervisor (Proxmox, so Debian, so systemd) to an hypervisor not running under Linux, like maybe bhyve on FreeBSD, I'll have all my VMs and containers and hypervisor totally systemd free (my VMs and containers are already systemd free: I did in anticipation of, at long last, giving systemd the middle finger).
But of course none of this matter much because according to HN we're already at a point in time where we can write: "Plz rewrite an init system".
The real question is: why don't people hate a rube-goldberg init system made by someone who went to work for Microsoft, while using crypto made up by his brother (certainly secure we're sure), and who then went on to create a full-on surveillance company working on locking down hardware?
Regain control of PID 1 people.
edit: Having written that, this tool looks very cool and useful when you need to deal with a systemd distribution.