Ubuntu 19.10 启动缓慢,尽管 systemd-analyze critical-chain 声称需要约 11 秒

Ubuntu 19.10 启动缓慢,尽管 systemd-analyze critical-chain 声称需要约 11 秒

所讨论的机器是 Acer Aspire 5 A15-52G-53PU,具有以下规格:

  • 中央处理器:i5-8265 1.6-3.9GHz
  • 8GB 内存
  • SSD(两个分区,537MB EFI,256GB Ext4)

用秒表测量,大约需要1分10秒按下电源按钮后显示桌面,然后再过 40 秒才打开网络浏览器,这看起来真的很奇怪,因为我还有另一台 8 年前的古老笔记本电脑,可以在 15 秒内启动 Windows 10。

按照,我有一个 2 GB 的交换文件sudo swapon --show

我对这台机器的另一个问题是,当它从睡眠状态唤醒时,只能短暂使用(通常足以输入我的密码并确认),然后冻结几秒钟才能再次响应。

以下是一些systemd-analyze输出:

$ systemd-analyze
Startup finished in 1.529s (kernel) + 11.126s (userspace) = 12.655s 
graphical.target reached after 11.115s in userspace

critical-chain

$ 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 @11.115s
└─multi-user.target @11.115s
  └─snapd.seeded.service @10.350s +764ms
    └─snapd.service @5.098s +5.247s
      └─basic.target @4.884s
        └─sockets.target @4.883s
          └─snapd.socket @4.864s +18ms
            └─sysinit.target @4.844s
              └─systemd-timesyncd.service @4.473s +370ms
                └─systemd-tmpfiles-setup.service @4.218s +248ms
                  └─local-fs.target @4.214s
                    └─run-user-1000.mount @9.998s
                      └─swap.target @571ms
                        └─swapfile.swap @406ms +150ms
                          └─systemd-remount-fs.service @335ms +45ms
                            └─systemd-journald.socket @320ms
                              └─-.mount @300ms
                                └─system.slice @300ms
                                  └─-.slice @300ms

blame

$ systemd-analyze blame
          9.105s fwupd.service
          6.453s upower.service
          5.247s snapd.service
          4.465s networkd-dispatcher.service
          4.040s udisks2.service
          3.720s ModemManager.service
          3.574s snap-gnome\x2dsystem\x2dmonitor-107.mount
          3.558s libvirtd.service
          3.515s snap-blender-33.mount
          3.507s snap-gnome\x2dsystem\x2dmonitor-111.mount
          3.454s snap-gnome\x2dlogs-73.mount
          3.384s snap-keepassxc-625.mount
          3.373s dev-sda2.device
          3.358s snap-gnome\x2dcalculator-536.mount
          3.345s snap-blender-34.mount
          3.324s snap-core-8039.mount
          3.290s snap-postman-94.mount
          3.289s snap-firefox-280.mount
          3.280s snap-gnome\x2d3\x2d28\x2d1804-110.mount
          3.265s snap-core18-1223.mount
          3.246s snap-postman-96.mount
          3.141s accounts-daemon.service
          2.995s dev-loop8.device
          2.965s dev-loop9.device
          2.905s dev-loop11.device
          2.774s dev-loop12.device
          2.703s dev-loop14.device
          2.636s dev-loop16.device
          2.548s dev-loop19.device
          2.547s dev-loop15.device
          2.507s dev-loop18.device
          2.492s dev-loop21.device
          2.477s dev-loop20.device
          2.391s dev-loop22.device
          2.335s systemd-resolved.service
          2.333s dev-loop30.device
          2.319s dev-loop23.device
          2.236s dev-loop26.device
          2.160s dev-loop29.device
          2.158s dev-loop28.device
          2.114s dev-loop25.device
          1.937s avahi-daemon.service
          1.925s bluetooth.service
          1.925s systemd-logind.service
          1.924s thermald.service
          1.903s grub-initrd-fallback.service
          1.889s secureboot-db.service
          1.873s switcheroo-control.service
          1.871s rsyslog.service
          1.869s lm-sensors.service
          1.859s wpa_supplicant.service
          1.838s apport.service
          1.836s grub-common.service
          1.825s gpu-manager.service
          1.792s NetworkManager.service
          1.726s vpnagentd.service
          1.148s snap-android\x2dstudio-80.mount
          1.087s snap-gnome\x2dcharacters-359.mount
           940ms snap-gnome\x2d3\x2d26\x2d1604-98.mount
           938ms snap-gnome\x2dlogs-81.mount
           891ms colord.service
           883ms snap-pycharm\x2dprofessional-171.mount
           879ms snap-gtk2\x2dcommon\x2dthemes-5.mount
           829ms snap-gnome\x2d3\x2d28\x2d1804-91.mount
           821ms snap-code-20.mount
           818ms snap-discord-93.mount
           775ms snap-gtk\x2dcommon\x2dthemes-1353.mount
           774ms snap-gimp-227.mount
           764ms snapd.seeded.service
           749ms snap-eclipse-40.mount
           707ms snap-keepassxc-590.mount
           701ms dev-loop10.device
           672ms [email protected]
           645ms gdm.service
           573ms snap-core-7917.mount
           545ms snap-gnome\x2dcalculator-544.mount
           534ms ssh.service
           526ms snap-gnome\x2dcharacters-367.mount
           521ms dev-loop0.device
           512ms apparmor.service
           504ms dev-loop1.device
           460ms systemd-journald.service
           446ms dev-loop2.device
           425ms dev-loop17.device
           422ms dev-loop13.device
           386ms snap-core18-1265.mount
           386ms systemd-rfkill.service
           385ms snap-intellij\x2didea\x2dultimate-188.mount
           380ms systemd-fsck@dev-disk-by\x2duuid-BEB4\x2dA3A8.service
           379ms snap-intellij\x2didea\x2dultimate-181.mount
           376ms snap-gimp-189.mount
           373ms snap-discord-101.mount
           373ms snap-gtk\x2dcommon\x2dthemes-1313.mount
           370ms systemd-timesyncd.service
           352ms dev-loop34.device
           325ms dev-loop35.device
           321ms dev-loop3.device
           308ms dev-loop33.device
           295ms dev-loop4.device
           280ms dev-loop7.device
           280ms dev-loop37.device
           274ms snap-android\x2dstudio-81.mount
           265ms ebtables.service
           252ms dev-loop32.device
           248ms systemd-tmpfiles-setup.service
           231ms snap-gnome\x2d3\x2d26\x2d1604-97.mount
           229ms dev-loop6.device
           211ms pppd-dns.service
           211ms dev-loop31.device
           206ms snap-code-21.mount
           201ms polkit.service
           192ms dev-loop24.device
           166ms hddtemp.service
           159ms systemd-journal-flush.service
           159ms dev-loop38.device
           157ms dev-loop39.device
           150ms swapfile.swap
           131ms kerneloops.service
           129ms packagekit.service
           120ms systemd-user-sessions.service
           108ms systemd-udevd.service
           105ms qemu-kvm.service
           103ms openvpn.service
            99ms systemd-udev-trigger.service
            96ms plymouth-read-write.service
            94ms keyboard-setup.service
            86ms setvtrgb.service
            84ms systemd-backlight@backlight:intel_backlight.service
            79ms boot-efi.mount
            74ms bolt.service
            72ms networking.service
            70ms dev-loop36.device
            67ms lvm2-monitor.service
            58ms libvirt-guests.service
            54ms console-setup.service
            49ms snap-pycharm\x2dprofessional-173.mount
            49ms snap-firefox-287.mount
            45ms ufw.service
            45ms systemd-remount-fs.service
            45ms dev-mqueue.mount
            44ms blk-availability.service
            40ms sys-kernel-debug.mount
            38ms dev-hugepages.mount
            38ms rtkit-daemon.service
            33ms [email protected]
            32ms systemd-update-utmp.service
            31ms systemd-modules-load.service
            31ms kmod-static-nodes.service
            25ms systemd-sysctl.service
            21ms sys-kernel-config.mount
            20ms systemd-sysusers.service
            20ms systemd-random-seed.service
            19ms sys-fs-fuse-connections.mount
            18ms snapd.socket
            18ms dev-loop40.device
            13ms dev-loop5.device
            13ms plymouth-quit-wait.service
            13ms systemd-tmpfiles-setup-dev.service
             7ms systemd-update-utmp-runlevel.service
             3ms ifupdown-pre.service

相关内容