引导时间很慢,性能差


13

我已经跳回使用Ubuntu的机会,但是Ubuntu 19.04的整体性能确实存在问题。它非常缓慢,它会锁定,但最糟糕的是它可能需要大约5分钟才能启动。

我有一台旧的Dell Optiplex 7010,它带有一个i3 3000处理器和8 GB的内存,并使用了Intel HD 3000板载显卡。因此,性能不应该是一个问题。

如前所述,我还是Ubuntu的新手,所以我还在学习。

搜索修复程序后,我发现此命令来查看启动Ubuntu所需的时间:

systemd-analyze blame

这给了我这个输出:

tux@tux-OptiPlex-7010:~$ systemd-analyze blame
    5min 13.441s sav-protect.service
    1min 20.310s apt-daily.service
         57.163s plymouth-quit-wait.service
         30.008s systemd-journal-flush.service
         27.969s dev-mapper-ubuntu\x2d\x2dvg\x2droot.device
         22.765s accounts-daemon.service
         22.205s snapd.service
         21.924s ModemManager.service
         19.630s networkd-dispatcher.service
         18.044s udisks2.service
         17.974s dev-loop30.device
         17.899s dev-loop26.device
         17.824s dev-loop49.device
         17.768s dev-loop34.device
         17.713s dev-loop55.device
         17.480s dev-loop45.device
         17.435s dev-loop29.device
         17.384s dev-loop48.device
         17.350s dev-loop31.device
         17.231s dev-loop2.device
         17.218s dev-loop39.device
         17.185s dev-loop40.device
         17.168s dev-loop44.device
         17.071s dev-loop46.device
         16.724s dev-loop19.device
         15.978s dev-loop51.device
         15.836s dev-loop43.device
         15.791s dev-loop47.device
         15.764s dev-loop41.device
         15.762s dev-loop50.device
         15.707s dev-loop42.device
         15.638s dev-loop37.device
         15.587s dev-loop38.device
         15.524s dev-loop54.device
         15.377s dev-loop35.device
         15.185s dev-loop33.device
         15.090s dev-loop24.device
         15.049s dev-loop7.device
         15.014s dev-loop14.device
         14.889s dev-loop13.device
         14.560s dev-loop53.device
         14.519s dev-loop52.device
         14.087s dev-loop15.device
         14.077s dev-loop32.device
         14.000s dev-loop20.device
         13.948s dev-loop27.device
         13.832s dev-loop3.device
         13.830s dev-loop8.device
         13.824s dev-loop11.device
         13.708s dev-loop6.device
         13.614s dev-loop25.device
         13.574s dev-loop36.device
         13.518s dev-loop16.device
         13.424s dev-loop23.device
         13.375s dev-loop10.device
         13.346s dev-loop28.device
         13.168s dev-loop21.device
         12.864s grub-common.service
         12.737s dev-loop17.device
         12.667s systemd-resolved.service
         12.616s avahi-daemon.service
         12.473s dev-loop18.device
         12.407s sddm.service
         12.358s rsyslog.service
         12.342s apport.service
         12.142s wpa_supplicant.service
         12.134s NetworkManager.service
         12.130s systemd-logind.service
         12.124s dev-loop9.device
         12.122s dev-loop12.device
         12.120s dev-loop22.device
         11.944s gpu-manager.service
         11.733s lm-sensors.service
         11.645s apparmor.service
         11.362s thermald.service
         11.075s tor@default.service
         10.956s switcheroo-control.service
         10.822s dev-loop0.device
         10.702s dev-loop4.device
         10.488s dev-loop1.device
         10.442s dev-loop5.device
          9.189s systemd-udevd.service
          9.112s NetworkManager-wait-online.service
          8.930s nginx.service
          8.629s snap.ufw.srv.service
          7.295s ufw.service
          6.514s networking.service
          6.239s fwupd.service
          5.406s gdm.service
          4.896s systemd-sysctl.service
          4.688s snap-gnome\x2d3\x2d26\x2d1604-90.mount
          4.641s user@1000.service
          4.472s snap-gtk\x2dcommon\x2dthemes-1313.mount
          4.304s snap-polar\x2dbookshelf-69.mount
          4.181s snap-chromium-821.mount
          4.023s snap-core18-1074.mount
          3.946s snap-webcatalog-10.mount
          3.872s snap-easy\x2dopenvpn-5.mount
          3.697s apt-daily-upgrade.service
          3.691s snap-code-13.mount
          3.680s virtualbox.service
          3.598s snap-gnome\x2dlogs-45.mount
          3.556s snap-ao-20.mount
          3.456s snap-riseup\x2dvpn-152.mount
          3.424s snap-gnome\x2d3\x2d26\x2d1604-70.mount
          3.375s snap-gnome\x2dcalculator-406.mount
          3.348s snap-hexchat-42.mount
          3.317s snap-core-5662.mount
          3.242s snap-odrive\x2dunofficial-2.mount
          3.157s snap-translatium-6.mount
          3.084s uwsgi.service
          3.010s snap-ufw-296.mount
          2.931s polkit.service
          2.925s snap-tinc\x2dvpn-2.mount
          2.825s snap-tusk-29.mount
          2.784s snap-ubuntu\x2dapp\x2dplatform-34.mount
          2.718s snap-gtk\x2dcommon\x2dthemes-701.mount
          2.693s snap-gnome\x2dlogs-61.mount
          2.643s snap-ubuntu\x2dcloud\x2dimage-63.mount
          2.582s snap-zaproxy-4.mount
          2.550s snap-nmap-564.mount
          2.511s snap-opera-47.mount
          2.369s snap-midori-550.mount
          2.278s snap-tor-2.mount
          2.278s lvm2-monitor.service
          2.264s systemd-modules-load.service
          2.194s snap-gnome\x2d3\x2d28\x2d1804-71.mount
          2.168s snap-deja\x2ddup-190.mount
          2.142s systemd-tmpfiles-setup.service
          2.135s snap-usdxworldparty-30.mount
          1.936s snap-xmr\x2dminer\x2dgui-9.mount
          1.753s snap-google\x2dplay\x2dmusic\x2ddesktop\x2dplayer-70.mount
          1.645s snap-webcatalog-4.mount
          1.525s lvm2-pvscan@8:1.service
          1.519s snap-john\x2dthe\x2dripper-297.mount
          1.470s privoxy.service
          1.402s snap-google\x2dwebapp-4.mount
          1.338s snap-chromium\x2dffmpeg-13.mount
          1.320s snap-gnome\x2dcharacters-124.mount
          1.253s snap-communitheme-1768.mount
          1.131s snap-canonical\x2dlivepatch-81.mount
          1.117s systemd-tmpfiles-setup-dev.service
          1.094s keyboard-setup.service
          1.044s plymouth-start.service
           988ms dns-clean.service
           916ms systemd-sysusers.service
           896ms snap-firefox-253.mount
           895ms snap-opera-46.mount
           833ms pppd-dns.service
           829ms snap-i2pd-25.mount
           828ms snap-gnome\x2dcalculator-238.mount
           796ms snap-gnome\x2dsystem\x2dmonitor-100.mount
           796ms snap-gnome\x2dcharacters-296.mount
           785ms tor.service
           772ms snap-google\x2dcloud\x2dsdk-95.mount
           740ms colord.service
           688ms snap-wonderwall-13.mount
           687ms snap-gnome\x2dsystem\x2dmonitor-57.mount
           575ms systemd-timesyncd.service
           557ms plymouth-read-write.service
           522ms snap-googletools\x2ddesktop-1.mount
           520ms snap-vlc-1049.mount
           497ms snap-gtk2\x2dcommon\x2dthemes-5.mount
           448ms grub-initrd-fallback.service
           429ms upower.service
           397ms ifupdown-pre.service
           387ms kerneloops.service
           320ms snapd.seeded.service
           311ms systemd-tmpfiles-clean.service
           311ms systemd-journald.service
           296ms dev-mqueue.mount
           295ms dev-hugepages.mount
           290ms dev-mapper-ubuntu\x2d\x2dvg\x2dswap_1.swap
           274ms systemd-udev-trigger.service
           265ms user-runtime-dir@1000.service
           265ms snap-qshodan-196.mount
           261ms systemd-backlight@backlight:acpi_video0.service
           219ms bolt.service
           217ms console-setup.service
           207ms setvtrgb.service
           203ms blk-availability.service
           201ms systemd-remount-fs.service
           178ms snap.canonical-livepatch.canonical-livepatchd.service
           173ms systemd-user-sessions.service
           168ms snap.easy-openvpn.easy-openvpn.service
           163ms hddtemp.service
           163ms sys-kernel-debug.mount
           161ms kmod-static-nodes.service
           152ms systemd-random-seed.service
           144ms snap.tor.tor.service
           124ms snap-hello\x2dworld-29.mount
           116ms snap-core-7396.mount
           115ms rtkit-daemon.service
           102ms proc-sys-fs-binfmt_misc.mount
            89ms systemd-update-utmp.service
            84ms systemd-update-utmp-runlevel.service
            59ms snapd.socket
            14ms openvpn.service
             4ms sys-fs-fuse-connections.mount
             3ms sys-kernel-config.mount

如您所见,有些东西不正确。如果有人可以帮助我解决此问题,我将不胜感激。

Ubuntu 19.04是一个相对较新的安装。但是我可以说我在进行全新安装时遇到了性能问题。希望有人可以帮助我纠正此问题。我期待着学习如何做。


2
您已安装了大量的快照应用程序。每个都是对性能的打击。删除每个按扣,然后将其替换为标准应用。
heynnema

缓慢的性能,尤其是锁定可能是硬盘驱动器出现故障的征兆-驱动器的固件可能试图多次重读故障扇区。我建议检查硬盘驱动器的SMART状态。
谢尔盖

1
@starkus Plymouth并行运行。如果其他引导过程完成得更快,那么它也将更快地完成。请阅读:askubuntu.com/a/1168249/968501
Raffa

Answers:


21

您已经安装了适用于Linux的Sophos Anti-Virus

sav-protect.service属于Sophos。请在这里阅读。也是sav-rms.service

sav-protect.service 是Sophos实时(按访问)扫描服务。

sav-rms.service 是Sophos远程管理系统服务。

延迟是由于启动时病毒扫描造成的,而整体性能不佳是由于实时(按访问)扫描造成的。请阅读类似的问题在这里这里这里

值得注意的是,这不是Sophos特有的问题。通常,这是反病毒软件的工作方式。他们需要系统资源来完成工作,随着工作量的增加,情况变得越来越糟。您使用的系统越多->触发的系统和文件访问进程越多->常规进程和对其进行扫描的防病毒程序消耗的系统资源就越多->系统越慢直到瓶颈出现,有时甚至停止为止,都没有响应。


如果在启动时进行病毒扫描和按访问进行扫描对于您的系统不是至关重要的,则可以禁用该服务并在启动时提高回速并提高系统响应速度。为此,请在终端中运行以下命令并重新启动系统:

sudo systemctl disable sav-protect.service

如果重新启动后它再次出现,则可以执行以下命令:

sudo systemctl mask sav-protect.service

如果在启动时收到有关实时保护被禁用的警报,则可以按照以下命令进行操作:

sudo systemctl disable sav-rms.service

如果重新启动后它再次出现,则可以执行以下命令:

sudo systemctl mask sav-rms.service

要随时回滚以上更改,请运行:

sudo systemctl unmask sav-protect.service

然后遵循以下步骤:

sudo systemctl enable sav-protect.service

然后遵循以下步骤:

sudo systemctl unmask sav-rms.service

然后遵循以下步骤:

sudo systemctl enable sav-rms.service

注意:

完成上述所有操作无需卸载Sophos Anti-Virus for Linux。它会保留在您的系统上,以便您可以使用防病毒软件的其他功能,或者以后可以回滚上面所做的更改,并根据需要返回完整的软件包。


6
实际上,我不确定Sophos是否应归咎于此。所有snap-*dev-loop*服务的总和大约为15分钟,在考虑了并行性之后,很可能需要5分钟才能启动所有服务。Sophos启动服务有可能只是部分等待所有快照的启动(因此可以确定它已扫描了它们)。
marcelm

@macelm snaps否则将在没有防病毒软件的情况下更快地运行。因此,我建议先禁用Sophos,然后再将已安装的软件包弄乱,以用debs替换快照。好点。谢谢
19'Aug

2
同意,Sophos当然不会使所有这些快照更快。对于OP,我认为值得研究(并尝试)这两个问题。
marcelm

1

大约1年前,在Debian 9上,我的gcc编译性能降低了50%。页面表隔离导致了此问题,它与Spectra / Meltdown有关。您可以在启动时从grub添加-no-pti。请注意,这是在Haswell i7上,并且只有在使用32位Linux时,在64位上才不会有这么大的性能下降。

您使用的是32位还是64位?


1
这似乎不是答案。如果您打算回答问题,请编辑您的答案以包括应用解决方案所需的步骤。例如,如果这是答案,如何在启动时从GRUB添加-no-pti。作为新的贡献者,您可能需要访问我们的帮助页面以了解我们的问答格式。
Nmath
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.