10 ms·
it's funny that many people mention boot time as a metric when for most servers, VMs and laptops the devices are either always on or sleeping. startup times do
by dmwilcox 2y ago
it's funny that many people mention boot time as a metric when for most servers, VMs and laptops the devices are either always on or sleeping. startup times do nothing in those cases.
personally I use a custom alpine live-usb that is immutable and I fully shutdown and start-up all the time. openrc doesn't give me any grief, the bulk of my startup time is copying my 500mb rootfs into a tmpfs
systemd for me is solidly "at work" software, and not stuff I'm a big fan of either (journald, networkd and the silly dns resolver all have serious issues). so please, keep away from my alpine or I'll have to fork -again- :)
- zja 2y agoBoot times are pretty important for serverless environments. Alpine, which uses musl, is very popular in those situations.
- blueflow 2y agoI thought serverless environments are containers and thus don't need to boot?
- amaccuish 2y agoThey still have a userspace to bring up.
- djbusby 2y agoAnd don't need systemd for that.
- tuetuopay 2y agonowadays serverless environments are microvms. that is, a standard machine type that is explicitly virtual (so device drivers have no wait time for hw to init). however, they don't either need userspace to boot because the function/application/whatever is likely init itself or not far off. so they need to boot, but only the kernel needs to boot.
- btreecat 2y agoThe biggest issue I ran into with OpenRC was the lack of metadata related to hot-plugging events. There currently is no way to fire specific events based on vendor/device id like you would with systemd. This forced me to write a shim script to enable USB passthrough with arbitrary k8s nodes. The shim was short but is very hacky and relies on 3p packages because the info needed isn't available in stock alpine. Blog post about it here: https://stephentanner.com/home-assistant-on-k3s.html https://stephentanner.com/home-assistant-on-k3s.html Follow up post in the works based on additional improvements up streamed to OpenRC. The biggest issue was getting literally anyone from the project to comment on the PR to progress it forward to acceptance.
- stefantalpalaru 2y ago[dead]
- blueflow 2y agoWith the musl/busybox/OpenRC stack, Alpine is top notch when it comes to battery use. Just by switching from Debian to Alpine i doubled the battery lifetime on my Acer A114 from 8 to 20 hours. This includes moderate use. "Can leave my charger at home" moment for me.
- ruthmarx 2y agoProbably not a musl thing so much as a way less crap running in the background thing.
- zx8080 2y agoSystemd daemons and subsystems?
- RealStickman_ 2y agoCould probably get similar improvements by using any distro with less "batteries included" than Debian. Though I'm not aware of any except Alpine which offer stable versions.
- jlokier 2y agoMy Debian 12 VM has been up for 4 days, and Xorg clocked 5 hours of CPU activity in that time, but systemd clocked only 9.5 seconds, and its subsystems each less than that. So I doubt if systemd and its subsystems are using much energy. It doesn't seem likely to explain 20 vs 8 hours battery.
- blueflow 2y agoIts less the cpu usage, but more the frequency of wakeups.
- deleted 2y ago[deleted]
- surajrmal 2y agoThere exists a world of devices that are off and need to power on within a few seconds. Think of your media console in your car. Have you actually profiles that copying the 500mb rootfs is the bulk of your boot time? At around 150MiB/s, which is common for USB these days, I would expect that to only take ~4s, and copying from ram location to ram location is far faster. I would expect your boot time is a lot longer than that.
- wed239023 2y agoBootloader most likely operates in much slower safe mode. Perhaps USB2, or even 1.1.
- nine_k 2y agoIDK; on my laptop, the boot time is dominated by opening the encrypted disk. From there it's well under 3 seconds to the Xfce login screen. (A T14, m.2 storage, runit as the init system.)
- graemep 2y agoI find the same. Combine that with sleep being far more frequent that restart, and boot times are unimportant. I think the need for faster boot comes from people who scale cloud servers or containers up and down a lot.
- nine_k 2y agoYes. But a cloud VM instance can boot very quickly, because it has fixed hardware and does not have to probe for physical devices. Waiting for enough random events to happen to init the encryption used to be a major drain of startup time; likely not a problem any more.
- nialv7 2y agoUnlocking encrypted disk isn't I/O bound though. The key derivation step is designed to take a set amount of CPU time (say, a second), so it's difficult to brute force.
- abcrawf 2y agoCan you provide any specifics of the serious issues you’ve encountered with journald and networkd? There were some performance issues with journald early on, but I know a lot of work has gone into it over the years (a coworker of mine, for example, improved the performance of log retrieval by 10x). And networkd has always fulfilled my needs nicely, so I’m curious what sort of trouble you ran into.
- candiddevmike 2y agoOnly issue I have with networkd is lack of adoption: network manager is pushed hard (Red Hat still clinging to nm for servers, ew) or want to add another abstraction around it (Canonical with netplan). It's an awesome, declarative way to manage networking, embrace it.
- mastax 2y agoYeah I really like networkd as well, switched my Debian servers to it. Netplan also seems fine.
- abcrawf 2y agoMan, we fought hard at Red Hat to get them to continue using networkd with their latest container-focused OS. Ultimately, the organization just had too much institutional momentum behind NM. Frankly, I’m disappointed that they lacked the imagination and drive to push the industry forward.
- 3np 2y agoGood on you. I hope they come around. IMO NM has no business on servers and systemd-networkd is relatively robust by now.
- Sesse__ 2y agojournald is still very, very slow. As in, getting the entries for a given process can take a minute or more, whereas just grepping a normal text file is nearly instant. It doesn't help that the default rotation settings are insane (like, why would using a certain percentage of my total space be fine, what if all programs thought that?). Generally I don't really understand what journald brings to the table. I'm sure there are esoteric setups where the hash chaining thing makes sense, but meh? A lot of things needed fixing and systemd fixed many of them, but everything journals is a terrible user experience for me.
- SubjectToChange 2y agoit's funny that many people mention boot time as a metric when for most servers, VMs and laptops the devices are either always on or sleeping. startup times do nothing in those cases. People bring it up because it's usually the first thing they notice. Of course the faster boot times are not what makes systemd great, rather it's what makes those fast boot times possible.
- graemep 2y agoSystemd is an indifferent OS with a great init system?
- cstrahan 2y ago(I’m guessing this is supposed to be a joke in a similar vein as “Emacs is a great operating system that desperately needs a text editor”.) You probably are looking for a different word, rather than “indifferent”. Indifference is a property of the observer/subject, not the observed/object. For example, if I don’t care about sports, I might say that I’m indifferent to the outcome of the game my friends are watching. Perhaps “mediocre” is what you’re looking for?
- graemep 2y agoSee definition 2 here: https://www.collinsdictionary.com/dictionary/english/indifferent https://www.collinsdictionary.com/dictionary/english/indiffe...
- syockit 2y agoWith the loss of S3 suspend, fast boot time is important again for laptop users.
- bee_rider 2y agoWhat happened to S3 suspend?
- Propelloni 2y agoNothing. But many devices today do not support it anymore, instead they support S2Idle. S2Idle is more power-efficient than running-idle but less efficient than even Standby. Its huge advantage is waking up virtually immediately. Linux has no problems running S2Idle but due to how S2Idle works, more components can wake up your system, therefore more components can misbehave, incl. devices attached by USB. Ugh.
- cout 2y agoHaving my laptop wake up when it's in my bag (and the exhaust vents are blocked) is the last thing I want.
- surajrmal 2y agoS2idle is also effectively how all smart phones and watches work. Note that not every wake up results in the same results though. Your phone wakes up all the time, but it doesn't necessarily do a lot of work when it wakes up. The same can be true for your laptop. It would be unlikely for it to wake up to the point where it needs active cooling. If it does the OS is doing something wrong.
- mixmastamyk 2y agohttps://news.ycombinator.com/item?id=41442490 https://news.ycombinator.com/item?id=41442490
- kasabali 2y agoMicrosoft sabotaged it.
- javert 2y ago> personally I use a custom alpine live-usb that is immutable and I fully shutdown and start-up all the time. openrc doesn't give me any grief, the bulk of my startup time is copying my 500mb rootfs into a tmpfs I'm assuming this is for a personal use computer. Can you talk more about the setup here? Sounds interesting. If the OS is immutable, where do you store personal data and how do you perform updates?
- zoobab 2y ago"If the OS is immutable, where do you store personal data" In a mounted folder. "how do you perform updates?" You use another image.
- intelVISA 2y agoAnd thus a new mind was awoken.
- javert 2y agoThis is patronizing. Especially since the response was tautological. You should not assume that I know nothing.
- javert 2y agoI was interested in a little more detail. Is the home directory on another USB, or maybe a laptop's built-in SSD? To add new software, is he creating a new custom image every time? Is this practical as a daily driver?
- rkangel 2y ago> it's funny that many people mention boot time as a metric For the majority of deployments of systemd, that's probably true. Note that this is a musl port, and that the existing musl port is from OpenEmbedded. It's embedded devices that are often using cut-down userspaces (e.g. using MUSL), and embedded devices often do care about startup time because they're not Always-On. E.g. the VTech baby monitor I've just bought is generally pretty good, but spends >10 seconds at a splash screen when you turn it on. No idea if it's Linux under the hood, but an optimised boot time would be great. In a previous work project, we need the Linux based software to be ready from low power state quickly (battery powered, only doing work occasionally). By getting the boot time down <1s, I could also avoid a load of sleep-state shenanigans - when we wanted to power save, we just turned off completely (there was already a supervisory micro to decide when to turn back on).
- throwaway984393 2y agoIt's pretty trivial for an embedded device to trim down the series of startup tasks to only what's required, and then just write a C program that does those steps. I certainly wouldn't pick up such a gigantic, complex and potentially insecure package as systemd for an embedded project. I want less moving parts, not more
- telotortium 2y agoIt depends on what you mean by embedded, I suppose. Having a service monitor to restart your jobs is pretty useful too, and it can be tricky enough to write a good one. Something like a baby monitor (to use an example mentioned elsewhere) might run almost as many services as a desktop Linux installation.
- 6SixTy 2y agoGood chance that baby monitor uses something like FreeRTOS, not Linux for doing it's stuff. If you are unlucky, it's Android and they did the bare minimum to have a functional product. E: Also, Android uses the Linux kernel, but similarities with Linux based operating systems pretty much stop there.
- tuetuopay 2y agoI don't want my fridge to take 5 minutes to boot. Seriously. I'm always super annoyed at the current state of smart appliances that take ages to power on because they run some half-assed linux on an underpowered processor that would give the apollo guidance computer a run for its money. And that's why I only have dumb appliances.
- bee_rider 2y agoHow often does a fridge need to reboot? I’d hope for a nice steady power supply to a fridge.
- maayank 2y agoWhat do you do for persistence? Simply copying back tmpfs to rootfs on shutdown?
- WhyNotHugo 2y agoThey said immutable OS, so I'd assume no persistence. Just power off instantly.
- MisterTea 2y agoI run a Void Linux Musl machine at home and cold boot time vs wake up is so trivial that it makes sense for me to shut down when I am finished. It takes about 10 seconds to boot to login, most of which is waiting for the POST operation to complete. In fact, I've has issues with sleep sometimes not waking up and the system hangs with a blank screen forcing a reset obliterating my session. In addition to that, sleep takes 20+ seconds to power down whereas a shutdown takes about 3 seconds. systemd to me isn't useful at all for the desktop and is a big contraption for firing off VM's and containers in a highly automated server environment. I dont miss it which means I have zero need for it.
- 1vuio0pswjnm7 2y ago"personally I use a custom alpine live-usb that is immutable and I fully shutodwn and start-up all the time... the bulk of my startup time is copying my 500mb rootfs into a tmpfs" If rootfs is immutable why copy to tmpfs.^1 Genuine question. Not Alpine or Linux-specific. For example, maybe it feels faster running binaries from tmpfs. Immutable directories can be mounted from compressed files e.g., squashfs, etc., on the USB media. Alternatively one can copy only the binaries that one acually needs at a given time. Then delete them from tmpfs when not in use to free up memory. 1. I do this is so I can pull out the USB stick. But I use a much smaller rootfs that fits in the kernel ramdisk.
- nialv7 2y agoThis not true nowadays when most "servers" are containers or VMs that are spun up on demand, and thus do need a fast (fraction of a second) boot time.