好的,Nice!我们来看看为什么开机这么久!
Tofloor
poster avatar
dzuiuabi
deepin
2017-12-29 17:27
Author
没有滑稽很不习惯。

  1. ~$ systemd-analyze
  2. Startup finished in 8.193s (kernel) + 53.255s (userspace) = 1min 1.448s
Copy the Code
开了1分多钟,我觉得我可以在睡一会儿然后……
然后在看看是什么东西这么拖后退。
  1. ~$ systemd-analyze blame
  2.          24.305s NetworkManager-wait-online.service
  3.           8.426s dev-sda8.device
  4.           6.966s ModemManager.service
  5.           6.621s nmbd.service
  6.           6.572s systemd-journal-flush.service
  7.           4.304s networking.service
  8.           4.301s smbd.service
  9.           3.954s accounts-daemon.service
  10.           2.965s NetworkManager.service
  11.           1.913s lightdm.service
  12.           1.823s avahi-daemon.service
  13.           1.775s systemd-logind.service
  14.           1.740s lvm2-monitor.service
  15.           1.696s keyboard-setup.service
  16.           1.552s systemd-binfmt.service
  17.           1.466s polkit.service
  18.           1.367s wpa_supplicant.service
  19.           1.362s lastore-daemon.service
  20.           1.333s systemd-backlight@backlight:acpi_video0.service
  21.           1.242s systemd-udevd.service
  22.           1.171s proc-sys-fs-binfmt_misc.mount
  23.           1.147s systemd-tmpfiles-setup.service
  24.           1.065s sys-kernel-debug.mount
  25.           1.035s dev-hugepages.mount
  26.            953ms systemd-modules-load.service
Copy the Code
哇呜~!第一次看见要启动这么长时间的服务,哇哦!抓住了一个大家伙!我在其他人晒出的开机时间和Blame也没看到NetworkManager-wait-online.service这个东西啊,怎么就占时间了嘛?

于是我找了一些资料

[page]

[size=13.3333px]Hi
[size=13.3333px]I see

[size=13.3333px]Code:
7.872s NetworkManager-wait-online.service

[size=13.3333px]when I run a

[size=13.3333px]Code:
systemd-analyze blame

[size=13.3333px]Is this normal?
[size=13.3333px]Seems like it is adding a LOT of time to my boot.

[size=13.3333px]Any way to optimize?

[size=13.3333px]Centos 7 + MATE install
[size=13.3333px]

[size=13.3333px]有人就回复了:
Nope.

the problem is that systemd assumes the network is ready for use as soon as it starts NetworkManager.

When this is the case, nearly all network dependent actions fail - from network based filesystems, name lookups, time synchronization, databases, network user identifications (LDAP/NIS/...).

So much fails that the systemd developers had to start modifying a ton of other applications (this one being NetworkManager).

NetworkManager-wait-online is required to delay until the network is usable. This required modification of NetworkManager to explicitly send a "ready" signal back to systemd. This normally works (DHCP clients got modified too). And even the database servers got modified for the same reason.

This is one of the reasons systemd is considered a poor design, and imposes a LOT of things on services.

意思就是这个服务必须要这样启动?网络服务,总而言之,很糟糕,我可能是这个论坛开机醉酒的用户

Reply Favorite View the author
All Replies
2 / 3
To page
avatar
doooooit
deepin
2017-12-29 21:00
#21
本帖最后由 shangxke 于 2017-12-29 13:02 编辑

SSD,NetworkManager 直接占了一半的时间

  1. ~$ systemd-analyze
  2.           Startup finished in 5.192s (kernel) + 8.924s (userspace) = 14.117s
  3. ~$ systemd-analyze blame
  4.           7.740s NetworkManager-wait-online.service
  5.           1.537s plymouth-quit-wait.service
  6.           1.068s mysql.service
  7.            854ms apt-daily.service
  8.            414ms dev-sdb1.device
  9.            341ms lightdm.service
  10.            236ms upower.service
  11.            184ms exim4.service
  12.            137ms systemd-timesyncd.service
  13.            114ms systemd-rfkill.service
  14.            112ms ModemManager.service
  15.            102ms systemd-journal-flush.service
  16.             99ms systemd-udev-trigger.service
  17.             98ms networking.service
  18.             96ms NetworkManager.service
  19.             95ms smbd.service
  20.             87ms plymouth-read-write.service
  21.             83ms nmbd.service
  22.             73ms user@1000.service
  23.             72ms lastore-daemon.service
  24.             68ms accounts-daemon.service
  25.             58ms bluetooth.service
  26.             58ms systemd-journald.service
  27.             53ms systemd-fsck@dev-disk-by\x2duuid-5AC4\x2dFB0C.service
  28.             46ms ssh.service
  29.             43ms systemd-udevd.service
  30.             42ms lvm2-monitor.service
  31.             39ms gdomap.service
  32.             36ms systemd-fsck@dev-disk-by\x2duuid-5e41451e\x2d9fd2\x2d4fa7\x2da0af\x2ddf0b505644f3.service
  33.             36ms plymouth-start.service
  34.             30ms systemd-modules-load.service
  35.             29ms polkit.service
  36.             25ms systemd-tmpfiles-setup.service
  37.             24ms udisks2.service
  38.             21ms systemd-tmpfiles-setup-dev.service
  39.             20ms systemd-tmpfiles-clean.service
  40.             18ms avahi-daemon.service
  41.             18ms systemd-logind.service
  42.             17ms wpa_supplicant.service
  43.             17ms home.mount
  44.             13ms virtualbox.service
  45.             13ms boot-efi.mount
  46.             13ms dev-mqueue.mount
  47.             13ms systemd-binfmt.service
  48.             12ms dev-hugepages.mount
  49.             11ms alsa-restore.service
  50.             11ms miracle-wifid.service
  51.             11ms miracle-dispd.service
  52.             10ms systemd-update-utmp-runlevel.service
  53.              9ms dev-disk-by\x2duuid-194c193f\x2d3dbc\x2d4787\x2d8d71\x2db7f378661252.swap
  54.              9ms systemd-remount-fs.service
  55.              9ms kmod-static-nodes.service
  56.              8ms systemd-user-sessions.service
  57.              7ms systemd-update-utmp.service
  58.              7ms systemd-backlight@backlight:intel_backlight.service
  59.              5ms sys-kernel-debug.mount
  60.              5ms proc-sys-fs-binfmt_misc.mount
  61.              5ms pppd-dns.service
  62.              4ms systemd-sysctl.service
  63.              4ms systemd-random-seed.service
  64.              3ms sys-fs-fuse-connections.mount
Copy the Code
Reply View the author
avatar
dzuiuabi
deepin
2017-12-29 23:53
#22

你这样的……我记得有个8秒的
Reply View the author
avatar
pikachuhy
deepin
2017-12-30 00:05
#23
  1. pikachu@DESKTOP-I5EFT4D:~/Desktop$ systemd-analyze
  2. Startup finished in 8.175s (kernel) + 42.504s (userspace) = 50.679s
  3. pikachu@DESKTOP-I5EFT4D:~/Desktop$ systemd-analyze blame
  4.          16.742s NetworkManager-wait-online.service
  5.          13.047s apt-daily.service
  6.           8.471s nmbd.service
  7.           7.197s plymouth-quit-wait.service
  8.           7.004s dev-sdb1.device
  9.           6.838s accounts-daemon.service
  10.           6.197s dev-loop0.device
  11.           5.336s ModemManager.service
  12.           4.557s bluetooth.service
  13.           4.529s tor@default.service
  14.           4.523s tor.service
  15.           4.522s pppd-dns.service
  16.           4.177s systemd-journal-flush.service
  17.           3.535s lastore-daemon.service
  18.           3.381s NetworkManager.service
  19.           3.187s systemd-udevd.service
  20.           2.033s lightdm.service
  21.           2.032s networking.service
  22.           1.740s privoxy.service
  23.           1.589s lvm2-monitor.service
  24.           1.186s systemd-tmpfiles-setup-dev.service
  25.           1.150s avahi-daemon.service
  26.           1.150s smbd.service
  27.           1.051s binfmt-support.service
  28.            974ms systemd-modules-load.service
  29.            879ms wpa_supplicant.service
  30.            878ms upower.service
  31.            795ms deepin-disks-swap.disk.swap
  32.            620ms polkit.service
  33.            577ms docker.socket
  34.            528ms systemd-tmpfiles-setup.service
  35.            513ms systemd-timesyncd.service
  36.            494ms systemd-binfmt.service
  37.            493ms plymouth-read-write.service
  38.            451ms sys-kernel-debug.mount
  39.            436ms systemd-logind.service
  40.            434ms kmod-static-nodes.service
  41.            427ms systemd-remount-fs.service
  42.            395ms systemd-backlight@backlight:intel_backlight.service
  43.            378ms proc-sys-fs-binfmt_misc.mount
  44.            376ms systemd-rfkill.service
  45.            346ms miracle-dispd.service
  46.            301ms dev-hugepages.mount
  47.            292ms systemd-journald.service
  48.            281ms systemd-udev-trigger.service
  49.            265ms miracle-wifid.service
  50.            216ms systemd-sysctl.service
  51.            175ms plymouth-start.service
  52.            161ms dev-mqueue.mount
  53.            135ms systemd-random-seed.service
  54.            129ms udisks2.service
  55.            101ms systemd-user-sessions.service
  56.             92ms systemd-update-utmp.service
  57.             81ms alsa-restore.service
  58.             76ms user@1000.service
  59.              3ms systemd-update-utmp-runlevel.service
  60.              2ms sys-fs-fuse-connections.mount
Copy the Code
Reply View the author
avatar
y***z@tom.com
deepin
2017-12-30 00:19
#24
Startup finished in 7.528s (kernel) + 20.036s (userspace) = 27.564s
Reply View the author
avatar
iminto
deepin
2017-12-30 00:21
#25
NetworkManager-wait-online.service 应该也可以关闭,但是关闭了后代理和VPN功能可能不能用了
Reply View the author
avatar
macaiyun0629
deepin
2017-12-30 00:33
#26
  1. Startup finished in 3.709s (kernel) + 5.084s (userspace) = 8.794s
Copy the Code
  1. systemd-analyze blame            
  2.           4.062s NetworkManager-wait-online.service
  3.           1.883s plymouth-quit-wait.service
  4.           1.036s xrdp.service
  5.            507ms keyboard-setup.service
  6.            406ms systemd-journal-flush.service
  7.            260ms lightdm.service
  8.            252ms dev-sda2.device
  9.            213ms systemd-modules-load.service
  10.            182ms systemd-hostnamed.service
  11.            176ms networking.service
  12.            136ms nmbd.service
  13.            117ms systemd-timedated.service
  14.            108ms teamviewerd.service
  15.             97ms ModemManager.service
  16.             89ms lastore-daemon.service
  17.             79ms NetworkManager.service
  18.             70ms ssh.service
  19.             69ms virtualbox.service
  20.             68ms tftpd-hpa.service
  21.             62ms smbd.service
  22.             53ms xrdp-sesman.service
  23.             52ms systemd-logind.service
  24.             47ms home-dev-Disk.mount
  25.             43ms upower.service
  26.             41ms systemd-udevd.service
  27.             40ms accounts-daemon.service
  28.             39ms cgroupfs-mount.service
  29.             38ms pppd-dns.service
  30.             33ms systemd-udev-trigger.service
  31.             30ms udisks2.service
  32.             30ms lvm2-monitor.service
  33.             27ms gdomap.service
  34.             27ms ntp.service
  35.             26ms setserial.service
  36.             26ms systemd-journald.service
  37.             24ms systemd-tmpfiles-setup-dev.service
  38.             24ms systemd-fsck@dev-disk-by\x2duuid-00629b34\x2d024c\x2d4b10\x2d81e5\x2db877fca90a83.service
  39.             24ms user@1000.service
  40.             19ms etc-setserial.service
  41.             19ms docker.service
  42.             17ms avahi-daemon.service
  43.             15ms polkit.service
  44.             15ms pyro-nsd.service
  45.             15ms plymouth-start.service
  46.             14ms lm-sensors.service
  47.             13ms miredo.service
  48.             13ms systemd-tmpfiles-setup.service
  49.             12ms systemd-binfmt.service
  50.             12ms plymouth-read-write.service
  51.             11ms hddtemp.service
  52.             10ms dev-disk-by\x2duuid-9bf58cf8\x2d0b68\x2d462a\x2da37b\x2ddb8d6bcf1028.swap
  53.              9ms fprintd.service
  54.              8ms binfmt-support.service
  55.              8ms systemd-remount-fs.service
  56.              8ms home.mount
  57.              8ms dev-mqueue.mount
  58.              7ms systemd-random-seed.service
  59.              7ms sys-kernel-debug.mount
  60.              6ms alsa-restore.service
  61.              6ms proc-sys-fs-binfmt_misc.mount
  62.              5ms dev-hugepages.mount
  63.              4ms systemd-update-utmp.service
  64.              4ms systemd-update-utmp-runlevel.service
  65.              3ms systemd-user-sessions.service
  66.              3ms exim4.service
  67.              3ms kmod-static-nodes.service
  68.              2ms systemd-sysctl.service
  69.              2ms console-setup.service
  70.              1ms sys-fs-fuse-connections.mount
Copy the Code
卸载了exim4后快了40秒,但感觉上没啥变化

Reply View the author
avatar
dzuiuabi
deepin
2017-12-30 00:43
#27
https://bbs.deepin.org/post/150831
NetworkManager-wait-online.service 应该也可以关闭,但是关闭了后代理和VPN功能可能不能用了 ...

这样啊?代理有时候要用。
Reply View the author
avatar
dzuiuabi
deepin
2017-12-30 00:44
#28
https://bbs.deepin.org/post/150831
卸载了exim4后快了40秒,但感觉上没啥变化

你本来都这么快了
Reply View the author
avatar
jlice
deepin
2017-12-30 01:06
#29
  1. $ systemd-analyze
  2. Startup finished in 3.955s (kernel) + 11.692s (userspace) = 15.647s
Copy the Code


  1. $ systemd-analyze blame
  2.           3.206s NetworkManager-wait-online.service
  3.           1.886s dev-sda6.device
  4.           1.622s smbd.service
  5.           1.425s lvm2-monitor.service
  6.           1.270s ModemManager.service
  7.           1.260s nmbd.service
  8.            964ms accounts-daemon.service
  9.            820ms NetworkManager.service
  10.            677ms systemd-fsck@dev-disk-by\x2duuid-cebe1c25\x2dff50\x2d4b7d\x2d955e\x2d4
  11.            496ms polkit.service
  12.            447ms systemd-binfmt.service
  13.            445ms systemd-modules-load.service
  14.            430ms systemd-remount-fs.service
Copy the Code
Reply View the author
avatar
kingskill
deepin
2017-12-30 04:56
#30
https://bbs.deepin.org/post/150831
卸载了exim4后快了40秒,但感觉上没啥变化

exim4是什么?请问怎么卸载?我机子上显示exim4占了足足15秒。
Reply View the author
avatar
redapple0204
deepin
2017-12-30 05:01
#31
说真的还是ssd用着爽。。
Reply View the author
avatar
ttfv
deepin
2017-12-30 05:22
#32
Startup finished in 9.717s (kernel) + 24.040s (userspace) = 33.758s

10.325s plymouth-quit-wait.service
          7.916s NetworkManager-wait-online.service
          4.844s dev-sda3.device
          3.492s systemd-journal-flush.service
          3.131s nmbd.service
          2.413s ModemManager.service
          2.403s networking.service
          2.353s lm-sensors.service
          2.350s systemd-logind.service
          2.341s alsa-restore.service
          1.904s systemd-tmpfiles-clean.service
          1.889s wpa_supplicant.service
          1.543s lvm2-monitor.service
          1.380s keyboard-setup.service
          1.191s accounts-daemon.service
          1.175s smbd.service
          1.129s NetworkManager.service
          1.126s systemd-udevd.service
          1.052s systemd-binfmt.service
           851ms systemd-modules-load.service
           788ms lightdm.service
           788ms proc-sys-fs-binfmt_misc.mount
           759ms systemd-tmpfiles-setup-dev.service
           746ms systemd-tmpfiles-setup.service
           664ms systemd-backlight@backlight:intel_backlight.service
           578ms dev-mqueue.mount
           575ms sys-kernel-debug.mount
           510ms dev-hugepages.mount
           508ms polkit.service
           488ms avahi-daemon.service
           479ms lastore-daemon.service
           458ms systemd-rfkill.service
           441ms upower.service
           399ms plymouth-read-write.service
           311ms console-setup.service
           301ms systemd-journald.service
           285ms systemd-udev-trigger.service
           281ms pppd-dns.service
           243ms miracle-dispd.service
           218ms systemd-sysctl.service
           200ms systemd-timesyncd.service
           175ms kmod-static-nodes.service
           160ms miracle-wifid.service
           135ms plymouth-start.service
           112ms user@1000.service
           102ms systemd-random-seed.service
            93ms systemd-update-utmp.service
            89ms udisks2.service
            70ms systemd-user-sessions.service
            54ms systemd-remount-fs.service
            12ms systemd-update-utmp-runlevel.service
             5ms sys-fs-fuse-connections.mount
Reply View the author
avatar
le******ly@163.com
deepin
2017-12-30 05:25
#33
  https://bbs.deepin.org/user/101846    https://bbs.deepin.org/user/33235    请过来看看吧,15.4时代比现在快多了
Reply View the author
avatar
dzuiuabi
deepin
2017-12-30 06:29
#34
https://bbs.deepin.org/post/150831
说真的还是ssd用着爽。。

可惜呀,老笔记本呢……老咯,就带不动咯,没这个精力哈哈哈
Reply View the author
avatar
dzuiuabi
deepin
2017-12-30 06:29
#35
https://bbs.deepin.org/post/150831
@aida    @wangyong    请过来看看吧,15.4时代比现在快多了

我好像也感觉到了15.4的魅力
Reply View the author
avatar
macaiyun0629
deepin
2018-01-01 10:27
#36
https://bbs.deepin.org/post/150831
exim4是什么?请问怎么卸载?我机子上显示exim4占了足足15秒。

邮件服务,我用不上
Reply View the author
avatar
firedrake
deepin
2018-01-01 17:53
#37
Networkmanager-wait-online 只是存在确实需要网络连通,不通就无法启动的服务时才需要的。
如果没有这样的服务是完全可以关闭的。
Reply View the author
avatar
arlly
deepin
2018-01-01 18:03
#38
systemd-analyze blame
          9.435s ntp.service
          8.605s NetworkManager-wait-online.service
           711ms lvm2-monitor.service
           285ms dev-sdb1.device
           167ms apparmor.service
           144ms lightdm.service
           143ms grub-common.service
           135ms ModemManager.service
           122ms systemd-logind.service
            95ms irqbalance.service
            87ms accounts-daemon.service
            75ms console-kit-log-system-start.service
            74ms NetworkManager.service
            72ms systemd-user-sessions.service
            65ms networking.service
            61ms thermald.service
            58ms avahi-daemon.service
            52ms console-setup.service
            52ms loadcpufreq.service
            47ms apport.service
            46ms virtualbox.service
            45ms systemd-udev-trigger.service
            43ms gpu-manager.service
Reply View the author
avatar
zino
deepin
2018-01-01 18:22
#39
https://bbs.deepin.org/post/150831
amor@amor-PC:~$ systemd-analyze
Startup finished in 3.315s (firmware) + 7.325s (loader) + 6.407s (ke ...

建议把docker.service和php设为手动启动吧。
Reply View the author
avatar
dzuiuabi
deepin
2018-01-01 18:30
#40
https://bbs.deepin.org/post/150831
Networkmanager-wait-online 只是存在确实需要网络连通,不通就无法启动的服务时才需要的。
如果没有这样的 ...

哇!谢谢呢!感谢你的回复。
Reply View the author
2 / 3
To page