r/linuxquestions • • 4d ago

What is your Linux boot time?

https://imgur.com/a/7YsaISF

Hello,

As the title says, how fast does Linux boot on your system? This is the output of "systemd-analyze" for my PC

Startup finished in 3.806s (firmware) + 77ms (loader) + 791ms (kernel) + 1.990s (userspace) = 6.666s

graphical target reached after 1.990s in userspace.

5 Upvotes

17 comments sorted by

4

u/Leather_Flan5071 4d ago

systemd-analyze

Startup finished in 1min 35.278s (firmware) + 2.449s (loader) + 1.231s (kernel) + 5.176s (initrd) + 13.001s (userspace) = 1min 57.136s

graphical.target reached after 12.955s in userspace.

2 minutes at best lmao

what can I even do to improve this

2

u/activedusk 4d ago

You will have to check UEFI or BIOS settings, if it is DDR5 it is usually ram training, memory context restore or simillar can reduce that time. Other usual causes, lots of peripherals attached or internal or external drives. Sometimes USB drives can delay boot time if in the boot list they are placed before the inernal drive which contains the boot partition and bootloader.

3

u/mredding 4d ago

You have to appreciate your OS came packaged to WORK, basically no matter the hardware configuration. It's meant to be convenient, and to fail conservatively. Typically you have a lot of laptop services, a lot of probing, a lot of timeouts, and a lot of adapters to bridge old software, even if it's new software.

Run systemd-analyze blame to get a list of what startup services are taking the longest; most of these services boot in parallel, so run systemd-analyze critical-chain to see what is directly between start and the graphical target.

me@ubuntu:~$ systemd-analyze blame
1.502s upki-fetch.service
666ms dev-vda2.device
656ms mnt-nas.mount
507ms dpkg-db-backup.service
427ms run-rpc_pipefs.mount
322ms networkd-dispatcher.service
// A whole bunch more...
me@ubuntu:~$ 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 @2.951s
└─gdm.service @2.847s +104ms
  └─systemd-user-sessions.service @2.806s +31ms
    └─network.target @2.761s
      └─NetworkManager.service @2.445s +315ms
        └─basic.target @2.444s
          └─dbus-broker.service @2.301s +142ms
            └─dbus.socket @2.291s +69us
              └─sysinit.target @2.285s
                └─systemd-binfmt.service @2.115s +168ms
                  └─proc-sys-fs-binfmt_misc.mount @2.130s +151ms
                    └─systemd-journald.socket @910ms +72us
                      └─-.mount @893ms
                        └─-.slice @893ms
me@ubuntu:~$ 

There's not much left to trim. This represents 10 seconds. I'm thinking of doing something about binfmt.service, because that registers how to launch foreign formats like exe with dosbox or wine, which I don't NEED to boot the system, it's a and frankly since I use a launcher, this is a service I don't use and don't want to expose to my system as a vulnerable surface and avenue for instability, so I can probably just cut that out. That'll be -168ms.

Very often you'll have several services in series that timeout on something, so it's worth figuring that out. Additionally, disable or uninstall services you have no use for; my workstation has no WiFi, so I was able to gut Ubuntu like a fish.

Your init process might be built with dracut which does some probing and THAT has a hard coded timeout of ~10 seconds. I don't know about you, but my system hardware isn't in flux. I shouldn't be probing for shit. I replaced it with initramfs-tools which has a pretty fixed time around a second.

My init filesystem image was almost 400 MiB. It was getting packed with Nvidia drivers. Fuck that, let modprobe find that LATER, in parallel with the rest of the boot sequence, once the system disk is mounted. What... I have to wait a fraction of a second longer for the splash screen? I have that disabled anyway, because it added 4 seconds to my boot time. This one was a sonofabitch, though, it required some modification of the update-initramfs scripts because every damn thing insisted on packing the driver modules in there. My init image is down to 28 MiB.

Being Ubuntu, I gutted Snap. It's proprietary anyway. Lots of fat services and do-nothing virtual loopback devices. Flatpack is better.

Anything you can defer from the critical chain, do it. I suggest starting a conversation with Google AI.

1

u/JackDostoevsky 4d ago

does it matter? are you rebooting often?

1

u/Leather_Flan5071 3d ago

Well, yeah? It’s a laptop

3

u/JackDostoevsky 4d ago

33.296s total

it doesn't matter though, i reboot my computer maybe once every 2-3 weeks

2

u/tomscharbach 4d ago edited 4d ago

As the title says, how fast does Linux boot on your system?

Solus Gnome loads to the login screen in about 18 seconds on my Dell Optiplex 3060 Micro (circa 2018) and in about 12 seconds on my Dell Latitude 3340 (circa 2023). I have no reason to dig deeper.

2

u/T_Friendperson12 Kubuntu 26.04.1 / Ubuntu-server 26.04.1 4d ago
user@PC:~$ systemd-analyze
Startup finished in 11.072s (firmware) + 12.197s (loader) + 9.415s (kernel) + 11.905s (userspace) = 44.590s  
graphical.target reached after 11.905s in userspace.
user@PC:~$ 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 .905s
└─power-profiles-daemon.service .872s +32ms
 └─multi-user.target .850s
   └─smbd.service .747s +102ms
     └─nmbd.service .822s +9.911s
       └─network-online.target .818s
         └─network.target .818s
           └─NetworkManager.service .680s +136ms
             └─dbus.service .532s +147ms
               └─basic.target .513s
                 └─sockets.target .512s
                   └─uuidd.socket .512s +22us
                     └─sysinit.target .500s
                       └─apparmor.service .427s +72ms
                         └─local-fs.target .425s
                           └─run-user-1000.mount .791s
                             └─local-fs-pre.target 
                               └─lvm2-monitor.service  +58ms
                                 └─systemd-journald.socket  +44us
                                   └─-.mount 
                                     └─-.slice 

Don't really need it to be much faster.

For my Server it's

user@server:~$ systemd-analyze
Startup finished in 11.650s (firmware) + 31.931s (loader) + 710ms (kernel) + 2.328s (initrd) + 5.629s (userspace) = 52.250s 
graphical.target reached after 5.628s in userspace.
user@server:~$ 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 .628s
└─multi-user.target .628s
  └─docker.service .085s +1.542s
    └─network-online.target .083s
      └─systemd-networkd-wait-online.service .488s +1.594s
        └─systemd-networkd.service .051s +423ms
          └─systemd-networkd-resolve-hook.socket .050s +36us
            └─network-pre.target .049s
              └─ufw.service .858s +191ms
                └─local-fs.target .824s
                  └─run-docker-netns-bf70493e4923.mount .166s
                    └─local-fs-pre.target 
                      └─systemd-tmpfiles-setup-dev.service  +16ms
                        └─systemd-tmpfiles-setup-dev-early.service+36ms
                          └─kmod-static-nodes.service u/345ms +29ms
                            └─systemd-journald.socket
                              └─system.slice
                                └─-.slice

2

u/recursion_is_love 4d ago
$ systemd-analyze 
Startup finished in 2.561s (kernel) + 3.123s (initrd) + 2.745s (userspace) = 8.430s 
graphical.target reached after 2.710s in userspace.

This is very old (15+ years, still using BOIS instead of EFI) computer with SSD.

2

u/illusory42 4d ago

Boots faster than I can make a coffee.

1

u/ahorsenamedjeff 4d ago

Not very fast because of ddr5 training

1

u/Awkward_Negotiation7 4d ago

I thought ddr5 training only happens when you change the ram timings

2

u/ahorsenamedjeff 4d ago

It does a short training on every boot.

1

u/mredding 4d ago
me@ubuntu:~$ systemd-analyze
Startup finished in 6.875s (kernel) + 3.594s (userspace) = 10.470s 
graphical.target reached after 2.951s in userspace.
me@ubuntu:~$ 

1

u/DryRAlN 4d ago

Total time 25.560s

1

u/green_meklar Debian 3d ago

Huh, I didn't know systemd-analyze was a thing. For me it says:

Startup finished in 14.176s (firmware) + 6.429s (loader) + 7.119s (kernel) + 15.820s (userspace) = 43.545s

Okay, so you win. But I only restart my PC once every few weeks on average, so my 44 seconds really doesn't trouble me.

1

u/iluvatar 3d ago

I haven't got a clue. I can't remember when I last rebooted. It happens so infrequently that the time taken is irrelevant. But since you asked:

Server:

[root@angband ~]# systemd-analyze Startup finished in 1.526s (kernel) + 2.700s (initrd) + 24.961s (userspace) = 29.188s graphical.target reached after 5.484s in userspace.

Desktop:

[root@leto ~]# systemd-analyze Startup finished in 29.350s (firmware) + 35.132s (loader) + 1.624s (kernel) + 8.801s (initrd) + 2min 52.510s (userspace) = 4min 7.419s graphical.target reached after 2min 52.492s in userspace.