Hacker News new | past | comments | ask | show | jobs | submit login

On many machines, the firmware is the largest contributor, with user-space services and their dependencies being the rest.

`systemd-analyze` (in particular, `systemd-analyze critical-chain` and `systemd-analyze plot > plot.svg`) are useful to diagnose. On my system you can see that my graphical session waits for systemd-user-session.service, which waits for network.target, which waits for NetworkManager taking its sweet time, which isn't started before network-pre which waits until nftables is done loading rules, etc.

Optimizing the service order and their dependencies does wonders for boot time.




> Optimizing the service order and their dependencies does wonders for boot time.

Why isn't this automatic? I'm pretty sure most of us have neither expertise not enthusiasm for that job.


It is automatic, but systemd obviously is constrained by the dependencies specified inside the unit files (that's kinda the point). The real question would be, why can't NetworkManager handle being started before everything is initialized. In turn the answer is probably "because it's hard"


I mean, it is, within the rule set specified by the config files. Distros just tend to explicitly default to the system being more fully up before presenting an interactive GUI because a lot of users' workflows expect that.


It is a matter of requirements. A login may require LDAP or Kerberos, which requires network connectivity. Pulling up network before the firewall is initialized could be dangerous. Maybe your desktop environment needs to play a jingle, so it by default waits for sound to init.

Service optimization is basically deciding what your system doesn't need in order to function for your usage, and moving things you don't need to a late initialization with no dependents. A distribution dedicated for a particular machine usage and desktop environment could do some tuning on your behalf, but it is not generic.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: