[systemd-devel] Help needed for optimizing my boot time

Francis Moreau francis.moro at gmail.com
Thu Jun 11 04:26:13 PDT 2015


Hi,

On 06/11/2015 12:44 PM, Andrei Borzenkov wrote:
> On Thu, Jun 11, 2015 at 1:08 PM, Francis Moreau <francis.moro at gmail.com> wrote:
>> Hello,
>>
>> I'm interested in optimizing my boot time on my laptop.
>>
>> So I looked at the big picture first:
>>
>>    $ systemd-analyze
>>    Startup finished in 3.994s (firmware) + 7.866s (loader) + 8.226s
>> (kernel) + 7.921s (userspace) = 28.007s
>>
>> and noticed that the boot time spent in userspace is quite high.
>>
>> I looked at the details:
>>
>>    $ systemd-analyze critical-chain
>>
>>    graphical.target @7.921s
>>      multi-user.target @7.921s
>>        autofs.service @7.787s +132ms
>>          network-online.target @7.786s
>>            network.target @7.786s
>>              NetworkManager.service @675ms +184ms
>>                basic.target @674ms
>>                  ...
>>
>> If I understand that correctly, NetworkManager takes more than 7 seconds
>> to start and seems to be the culprit.
>>
>> However, I'm not sure to understand why the service following NM
>> (autofs) and thus multi-user.target need to wait for the network to be
>> available.
>>
>> Specially since:
>>
>>  - nothing requires a network connection in order to boot and setup my
>> system, including mounting /home partition
>>
>>  - autofs should still be working if there's no network connection and
>> detect if the network becomes ready later
>>
>> So my question is: in this case, is autofs wrongly waiting for the
>> network to be started or is NM taking too much time to start ?
>>
> 
> Is NetworkManager-wait-online.service enabled and active?
> 

It seems it's enabled but no more active:

$ systemctl status NetworkManager-wait-online.service
● NetworkManager-wait-online.service - Network Manager Wait Online
   Loaded: loaded
(/usr/lib/systemd/system/NetworkManager-wait-online.service; disabled;
vendor preset: disabled)
   Active: inactive (dead) since Thu 2015-06-11 11:54:37 CEST; 1h 4min ago
  Process: 583 ExecStart=/usr/bin/nm-online -s -q --timeout=30
(code=exited, status=0/SUCCESS)
 Main PID: 583 (code=exited, status=0/SUCCESS)

Jun 11 11:54:30 cyclone systemd[1]: Starting Network Manager Wait Online...
Jun 11 11:54:37 cyclone systemd[1]: Started Network Manager Wait Online.

This seems correct to me, doesn't it ?

Thanks


More information about the systemd-devel mailing list