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

Harald Hoyer harald.hoyer at gmail.com
Thu Jul 16 02:20:25 PDT 2015


On 11.06.2015 16:54, Francis Moreau wrote:
> On 06/11/2015 01:40 PM, Andrei Borzenkov wrote:
>> On Thu, Jun 11, 2015 at 2:26 PM, Francis Moreau <francis.moro at gmail.com> wrote:
>>>>>
>>>>>    $ 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
>>>>>                  ...
>>>>>
>> ...
>>>> 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 ?
>>>
>>
>> Actually it says "disabled" which makes me wonder why it run. But this
>> is the service that is likely responsible for long time you observe.
>> If disabling it does ot help, you can try masking it (systemctl mask)
>> for a test.
>>
> 
> Masking this service helps:
> 
> $ systemd-analyze
> Startup finished in 3.323s (firmware) + 6.795s (loader) + 8.342s
> (kernel) + 1.470s (userspace) = 19.932s
> 
> $ systemd-analyze critical-chain
> The time after the unit is active or started is printed after the "@"
> character.
> The time the unit takes to start is printed after the "+" character.
> 
> graphical.target @1.470s
>   multi-user.target @1.470s
>     autofs.service @1.024s +445ms
>       network-online.target @1.023s
>         network.target @1.021s
>           NetworkManager.service @731ms +289ms
>            basic.target @731ms
> 
> and the system seems to run fine (specially autofs, ntpd).
> 
> But I think the time given by systemd-analyze (1.470s) is not correct.
> When booting I can see that the userspace is doing a fsck on root which
> takes more than 2s. And the login screen takes at least 5s to appear
> once the fsck is starting.
> 
> Is the time spent in initrd is included in userspace ?

Well, seems like systemd is not running in the initrd, so it's accounted to
kernel, which seems possible seeing 8.342s spent there.


More information about the systemd-devel mailing list