FreeBSD 14-CURRENT 12s boot to desktop (sway) reddit / freebsd ---------------------------------------------------------------------- Qiu3344 · 2022-01-07 15:39 Huge thank you to all of the developers who are working on improving the boot time! ---------------------------------------------------------------------- Xerxero · 2022-01-07 16:08 And how long took it on 13? Need something to compare it to. But 12s is pretty fast ---------------------------------------------------------------------- shawnwork · 2022-01-07 16:08 Impressive, what’s the pc spec? How about a Linux distro? ---------------------------------------------------------------------- perciva · 2022-01-07 16:33 You're welcome. ;-) If you want to help make this even faster, build a kernel with options TSLOG and generate a flamechart with my freebsd-boot-profiling code. ---------------------------------------------------------------------- marmulak · 2022-01-07 16:53 Out of the box??? Or did you do customizations ---------------------------------------------------------------------- dannomac · 2022-01-07 17:17 Don't know about a desktop, but my 13 build system takes about a minute from the bootloader to ssh & some jails running. ---------------------------------------------------------------------- Xzenor · 2022-01-07 17:18 Yeah SSD's are fast like that... ---------------------------------------------------------------------- Qiu3344 · 2022-01-07 17:27 You can read about the improvements that were implemented so far [here](https://wiki.freebsd.org/BootTime). The page also contains a comparison with 11.1-RELEASE. ---------------------------------------------------------------------- shellmachine · 2022-01-07 17:36 Details? ---------------------------------------------------------------------- Qiu3344 · 2022-01-07 17:54 CPU: Intel i5-7500 SSD: ADATA SX6000PNP GPU: integrated It would probably boot even faster if my root partition wasn't encrypted. Currently my setup feels like it boots just as fast as Alpine Linux did, which I was using a few years ago. Systemd-based distros boot probably a bit faster. So if you want to compete with them I can recommend you [runit](https://www.freshports.org/sysutils/runit-faster/). It also has a parallel boot process. ---------------------------------------------------------------------- Qiu3344 · 2022-01-07 18:00 I don't think there are any \`loader.conf\` options that can significantly improve the boot time. I just disabled the splash screen and set the proper UEFI resolution. I also wrote a service to start sway automatically. ---------------------------------------------------------------------- Xerxero · 2022-01-07 18:50 So from 28.2 to 9.4s. Really nice improvement ---------------------------------------------------------------------- [deleted] · 2022-01-07 19:30 [deleted] ---------------------------------------------------------------------- mirror176 · 2022-01-07 19:56 I usually run FreeBSD stable on this old desktop (i7-3820 CPU, gtx570 GPU) with BIOS boot(?) on magnetic drive. Is output from that desired too? Presume we follow instructions at [https://wiki.freebsd.org/BootTime](https://wiki.freebsd.org/BootTime) under Boot Time; why no port tree entry? Thank you from me to all who build and improve FreeBSD. ---------------------------------------------------------------------- perciva · 2022-01-07 20:08 More data is always better! I didn't bother putting it into the ports tree because it's such a small amount of code, doesn't need to be compiled (hence no advantage to having precompiled packages) and I figured most people using it would have git already installed. ---------------------------------------------------------------------- perciva · 2022-01-07 20:08 More speedups coming soon, too. ---------------------------------------------------------------------- mirror176 · 2022-01-07 20:10 Welp, guess its time I go back to customizing the kernel again; here comes another slow build. :) ---------------------------------------------------------------------- perciva · 2022-01-07 20:25 Yeah, that's the other thing -- most of the work is in building a new kernel. If you're doing that already then checking out a git repo isn't a big deal in comparison. ---------------------------------------------------------------------- obiwac · 2022-01-07 22:15 Who tf downvoted you ---------------------------------------------------------------------- cbg_27 · 2022-01-07 22:49 I don't know much about bsd, but for really fast boot times, maybe take a look at clear linux. It isn't actively worked on making it a usable desktop though, and it is pretty much limited to flatpak/appimage/compiling from source. If you have a rather modern intel processor and an ssd, it should boot in between 1~3 seconds to the desktop. ---------------------------------------------------------------------- IanArcad · 2022-01-07 22:55 That's pretty great. So glad to see FreeBSD continuing to innovate, especially while Apple just stagnates LOL. What will I do with all of those extra seconds in my day though? ---------------------------------------------------------------------- zachsandberg · 2022-01-08 00:25 >while Apple just stagnates Well uh, Apple solved the boot time thing around 2005 with OSX Tiger. ---------------------------------------------------------------------- zachsandberg · 2022-01-08 00:27 My system is an AMD EPYC 7443P running FreeBSD 13, and it takes quite a while to start up even with the horsepower and NVMe disks. ---------------------------------------------------------------------- edthesmokebeard · 2022-01-08 01:14 Can someone explain the fascination with boot times, especially on a system you should never be rebooting? ---------------------------------------------------------------------- aidopotatospud · 2022-01-08 01:30 Woooow, well that's frickin sweet! ---------------------------------------------------------------------- CoolTheCold · 2022-01-08 02:20 This is mostly for desktop oriented appliances I think. Or may be VMs. ---------------------------------------------------------------------- Gastkram · 2022-01-08 03:18 That rounds to 13s. ---------------------------------------------------------------------- ColibriPrime · 2022-01-08 03:49 What does Linux have to do with this? The OP isn't demonstrating his PC... ---------------------------------------------------------------------- shawnwork · 2022-01-08 03:53 Wanted to compare the performance of a Linux distro, hence I asked about the spec of the pc. ---------------------------------------------------------------------- vladivakh · 2022-01-08 10:21 How can I update my FreeBsd 13 to the 14-CURRENT? Is there any article about that? ---------------------------------------------------------------------- EtherealN · 2022-01-08 11:24 Because I boot my computers a lot. If I'm not using the desktop or laptop, I turn it off. Saves electricity, heat generation, battery life etc etc. On a server, nah, this is not relevant. But why would it be a bad thing to improve boot times for desktop use? I currently mostly have Arch Linux as my daily driver on desktop, because I'm waiting for availability of the Framework laptop in my country while my current laptop simply is not compatible with FreeBSD. Boot (and shutdown) times of \~2-3 seconds are a great quality of life improvement. It enables the sequence of "oh, I should do X" to "I'm doing X now" to just happen. Replacing "oh, I should do X" and "waiting... waiting...". The same applies for "Ok, done, time to pack up the laptop" and having it be shut down 2 seconds later is just... nice. Basically, the operative word here is "boot time". Not "reboot time". ---------------------------------------------------------------------- EtherealN · 2022-01-08 11:27 The answer is basically: depends on the distro. My Arch systems boot in about 2 seconds. Same for shutdown. Systems without systemd probably take longer since poetterware is mostly the secret sauce behind Linux desktop boot times nowadays, I think. (Cue philosophical discussion about whether poetterware is worth that advantage or not etc.) ---------------------------------------------------------------------- Qiu3344 · 2022-01-08 15:17 You can find the info in [this](https://docs.freebsd.org/en/books/handbook/cutting- edge/#makeworld) section of the handbook ---------------------------------------------------------------------- hertzbug · 2022-01-08 15:34 From personal experience, using s6 on Alpine Linux boots a bit faster than runit because: 1. unlike runit, stage one init (mounting pseudo fs, etc) on s6 is parallel. 2. if your init scripts are written in `excecline`, you heavily cut down on syscall overhead because you avoid `fork`. ---------------------------------------------------------------------- inco · 2022-01-08 22:47 Modern computers support low power and hibernate. If you're using a laptop there really isn't a good reason to poweroff. It can either sleep or hibernate. ---------------------------------------------------------------------- EtherealN · 2022-01-09 00:38 If the boot time is 2 seconds, why should I care about the difference? Sleep and Hibernate is meant to save me boot time. That is their one purpose, their one reason for existing as technologies. If boot time is so short I don't notice... Also, you are with Sleep and Hibernate assuming that I care about what I was doing in my previous session. Usually, I don't. I do not need whatever browser session I was using to check the news yesterday, today. ---------------------------------------------------------------------- inco · 2022-01-09 00:47 Know that you are in the minority. You can close your applications such as your browser. I will however will take my instantly available computer rather then wait for it to bootup. You aren't saving any power. ---------------------------------------------------------------------- EtherealN · 2022-01-09 00:50 The argument "know that you are in the minority" is extremely weird in a FreeBSD subreddit. How about we all just use Windows? Or let's just go Linux and have both fast boot/shutdown AND Sleep/Hibernate? Your argument is so confused I'll just let you get on with it. ---------------------------------------------------------------------- inco · 2022-01-09 00:54 Sleep and hibernate have been around for twenty years. Yes you're a minority within a minority. I would have appreciated not to have your snark. ---------------------------------------------------------------------- Xerxero · 2022-01-10 07:38 I thought Arch used systemd ---------------------------------------------------------------------- EtherealN · 2022-01-10 07:41 Yes, Arch uses Systemd. I have not said it doesn't. ---------------------------------------------------------------------- Xerxero · 2022-01-10 07:49 Ah misread the \`Systems **without** systemd..\` ---------------------------------------------------------------------- EtherealN · 2022-01-12 22:55 Ah, so, the laptop I use once a week on average for couch work should sit there sleeping to "save power"? Sure. Also, sleep and hibernate were invented as a \_workaround\_ to the problem of long boot/shutdown times. So now we have a workaround and therefore we shouldn't work on the problem that made us want a workaround? Sure. It makes total sense! Or when my work macbook pro opens up at 40% battery on monday morning because (surprise!) I didn't use it during the weekend. Critically, though, my personal laptop boots so fast that there is no real difference between "hibernate" and boot up - unless I need to get back to whatever I was doing. (Yes, I tested this.) But it is very rare that I need to have the exact same browser/terminal/vim/whatever/etc sessions the next time I open my laptop or desktop. So, in the hibernate case, why should I spend time waiting for my SSD to read data into RAM to bring those back? (For my work macbook, this is more relevant to get back because it helps me clock out at 5 instead of giving my employer the time I wait for that sluggish piece of crap to shut down or boot up. :P ) Similarly, Sleep keeps stuff in RAM, meaning more power usage than Hibernate (but faster boot), but... I don't need that data. I do NOT need the data of the CNN website (or whatever) I browsed several days ago. I need whatever I need now. Hilariously, one of the advantages of Sleep is touted as "your data is still safe, because your system will hibernate if battery power goes low". Hurp? As for "snark", right back at you. Arguments about "minority" in a BSD forum is just... what? Argue facts, not put-downs, if that's what you want in return. Now, if you want some proper modern stuff, go for a fingerprint sensor on your power button that stores your credentials for when the OS is booted up 2 seconds later. (Though sadly often locked behind proprietary drivers, so ah well... But you know, if modern inventions is the argument you want to go for. :P ) ---------------------------------------------------------------------- inco · 2022-01-12 23:17 Coming back from sleep and hibernate is so much faster then a cold boot. The amount of power it takes to refresh memory is very minimal to the point that you're saving what seconds maybe a few minutes per day? Not worth it. If it's more then that your battery is bad or some process is waking up your computer periodically. Macs aren't usually sluggish; something else is going on with it. You do you, I'll keep what I see as the better solution with my computers. but if you truely don't keep long running programs going then keep doing what you're doing. Saying you are a minority is not a put down. It's a fact. It wasn't meant to be offensive or loaded language. In the slightest. I suggest you stop thinking it was an insult. It wasn't. I still don't appreciate your snark. Which I have not once had with you. If I had known you'd take it so personality I would have left that fact off. I also not once brought up alternative operating systems and if I did I would be quick to point out where they are better and where freebsd could be improved. Being critical is not to be confused with snark. ---------------------------------------------------------------------- Arya_Kiran · 2022-01-14 09:45 nice even tho i will never use an OS that groups sway under x11-wm ;) ---------------------------------------------------------------------- grahamperrin · 2022-01-16 18:39 Thanks! To all concerned. This: % sysrc -f /etc/rc.conf rc_parallel_start rc_parallel_start: YES % – I know, ceased to take effect long ago, however I lazily leave it enabled with an assumption that eventually, it'll become effective again. ---------------------------------------------------------------------- grahamperrin · 2022-01-16 19:04 Maybe the same persontf who down-voted here: ---------------------------------------------------------------------- grahamperrin · 2022-01-16 19:18 > build a kernel with options TSLOG Is `/etc/src.conf` the place for that? (Sorry; I'm only half-OK with this file, and FreeBSD Forums, where I might have seen an answer, involving a symlink, are down at the moment.) Postscript: now I'm confused because I see a different `/etc/make.conf` exemplified at … not that I'm confusing PkgBase with anything, I'm just not sure which of the two files is suitable for kernel configuration lines. ---------------------------------------------------------------------- perciva · 2022-01-16 20:10 You want to put `options TSLOG` into your kernel configuration (aka add it to the end of `/usr/src/sys/amd64/conf/GENERIC`). ---------------------------------------------------------------------- grahamperrin · 2022-01-16 21:05 Thanks. I chose to add to the tail of both `/usr/src/sys/amd64/conf/GENERIC` and `/usr/src/sys/amd64/conf/GENERIC-NODEBUG` ---- ## `/etc/src.conf` Should I comment out this line? `WITH_MALLOC_PRODUCTION=yes` I most often build `GENERIC-NODEBUG` alone with the above, because I rarely need to debug things, however I'm happy to build both kernels i.e. `KERNCONF=GENERIC GENERIC-NODEBUG` ---------------------------------------------------------------------- perciva · 2022-01-16 21:08 The debugging which is turned on in HEAD doesn't affect boot times much; I wouldn't bother touching it. ---------------------------------------------------------------------- grahamperrin · 2022-01-16 21:57 Building now (nearing 22:00 in the UK). Results tomorrow, maybe. It's an old, relatively slow (5,400 RPM) HP EliteBook 8570p that's sped up hugely, qualitatively, by two low-end USB (thumb) flash drives for L2ARC. I look forward to getting a feel of how things are with your improvements. Big thanks! ---------------------------------------------------------------------- mirror176 · 2022-01-18 23:54 Had other things going on but took over 5 hours if I recall for the rebuild; thats with WITH\_META\_MODE option and filemon loaded. Not sure how to attach results but got 98593ms total time. Steps on the wiki don't have [mkflame.sh](https://mkflame.sh) and leads to a svg that doesn't even include that summarized result. Definitely waits longer than the <3 seconds that are listed on each of clamav, mysql, etc. visually during boot. Not sure how to attach a picture though many bubbles are not readable anyways. The raw log is 15MB. FreeBSD 13.0-STABLE FreeBSD 13.0-STABLE #2 stable/13-n248897-a05c15afe63: Sun Jan 9 17:47:47 MST 2022 ---------------------------------------------------------------------- vladivakh · 2022-04-06 20:08 How? My current boots up in about the same time as my 13! What sorcery is this?