12

I have jumped back into using Ubuntu again, but I am having real issues with the overall performance of Ubuntu 19.04. It's very sluggish, it locks up, but the worst is that it can take about 5 mins to boot up.

I have an old Dell Optiplex 7010 with an i3 3000 processor with 8 GB of ram and using Intel HD 3000 onboard graphics. So performance shouldn't be such an issue.

As I mentioned I'm still new to Ubuntu so I'm still learning.

After searching for a fix, I found this command to see what's taking so much time to boot Ubuntu:

systemd-analyze blame

Which gives me this output:

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

As you can see something is not right. I'd appreciate if somebody could help me fix this please.

Ubuntu 19.04 is a relatively fresh install. But I can say I've had performance issues from clean installation. I hope someone can help me rectify this please. I'm looking forward to learning how to do so.

  • 2
    You have a ton of snap apps installed. Each one is a performance hit. Remove each snap and replace it with a standard app. – heynnema Aug 24 at 17:03
  • Sluggish performance and especially lockups may be a symptom of a failing hard drive - the drive's firmware may be trying to re-read failing sectors multiple times. I suggest checking the hard drive's SMART status. – Sergey Aug 27 at 20:51
  • Your plymouth-quit-wait.service takes a little long time to boot. Try to install the haveged package to give some more entropy to your system. Also your apt-daily.service takes some time... You could find a workaround here: askubuntu.com/q/1038923/196781 – starkus Aug 30 at 5:09
  • 1
    @starkus Plymouth runs in parallel. If the other boot processes finish faster, it will finish faster too. Please, read: askubuntu.com/a/1168249/968501 – Raffa Aug 30 at 11:39
21

You have Sophos Anti-Virus for Linux installed:

sav-protect.service belongs to Sophos. Please read here. So does sav-rms.service.

sav-protect.service is Sophos Real-Time (On-Access) Scanning service.

sav-rms.service is Sophos Remote Management System service.

The delay is due to boot-time virus scan.While the sluggish overall performance is due to real-time (on-access) Scanning. Please read similar issues here, here and here.

It is worth noting that this is NOT an issue specific to Sophos. This is generally how Anti-Virus software work. They demand system resources to do their job and it gets worse with higher workloads. The more you use your system --> the more system and file access processes are triggered --> the more system resources are used up by both your regular processes and the Anti-Virus that scans them --> the more your system becomes sluggish and non-responding until it reaches a bottleneck and sometimes it halts.


If virus scan at boot-time and on-access is not critical for your system, you can disable the service and gain back speed at boot-time and system responsiveness. To do this, please run the following command in the terminal and reboot your system:

sudo systemctl disable sav-protect.service

If it shows up again after reboot, you can follow the above command with this:

sudo systemctl mask sav-protect.service

If you get alerts at boot-time about real-time protection being disabled, you can follow the above commands with this:

sudo systemctl disable sav-rms.service

If it shows up again after reboot, you can follow the above command with this:

sudo systemctl mask sav-rms.service

To roll back the above changes anytime, please run:

sudo systemctl unmask sav-protect.service

Then follow it with this:

sudo systemctl enable sav-protect.service

Then follow it with this:

sudo systemctl unmask sav-rms.service

Then follow it with this:

sudo systemctl enable sav-rms.service

Notice:

All the above is done without the need to uninstall Sophos Anti-Virus for Linux. It will remain on your system so that you can use other features of the Anti-Virus or you can later roll back the changes done above and go back to the full blown package as you wish.

  • 6
    I'm actually not sure Sophos is fully to blame here; all the snap-* and the dev-loop* services add up to some 15 minutes, which after accounting for parallelism might well take 5 minutes to start all of them. It's possible that the Sophos startup service is partly just waiting for all the snaps to start (so it can be sure it scanned them). – marcelm Aug 24 at 22:23
  • @macelm snaps and otherwise, will run much faster without an Anti-Virus. So, I recommend disabling Sophos first before messing with the installed packages to replace snaps with debs. Good point though. Thank you – Raffa Aug 25 at 5:45
  • 2
    Agreed, Sophos certainly won't make all those snaps faster. For the OP, I think it's worth looking at (and experimenting with) both issues. – marcelm Aug 25 at 8:27
7

TL;DR ~ Remove your anti virus and change your startup applications so all of them don't start up during boot, also disable services like Nginx and VirtualBox on boot, they aren't necessary on boot.

There are a few things you can do to speed up your boot time.

  1. Remove your anti virus, it isn't necessary on Ubuntu. If you really wanted to enable some security then enable the UFW firewall that comes with Ubuntu, you can do this with sudo ufw enable. If you were running a production server then you might look into things like anti viruses but for a personal computer and general use it's really not necessary. A lot of your security depends on what you do and how you use websites, so just don't mindlessly click links and what not. The anti virus isn't necessary.

  2. Even without the anti virus, 1 min for /dev/loop packages is still way too slow. Snap is an awesome package manager that allows many companies to now port their software to Linux, however looking at your log it shows something like 50+ packages being mounted at startup, which means that you installed a ton of things. So go to your startup applications and disable the ones you really don't need during startup.

  3. If you installed any services like Nginx or VirtualBox, which you did, or any other services beyond the default Ubuntu services, these will also need to start up during boot, so you can also disable them from automatically starting during boot and only starting them when you need them.

  4. For some or other reason you might also have hardware issues or drivers missing or something like a network connection holding up your startup, a lot of times Ubuntu can cause random issues with drivers, so you can also use additional commands like sudo dmesg to check for any issues around hardware and make sure everything is recognized and running smoothly.

  5. If all else fails you can disable your Ubuntu startup logo by going to /etc/default/grub and changing the splash screen to just empty "", so that you can see the startup process in detail. A lot of times when things are slow you can easily see what service is hanging or showing red or causing issues for you. Just be careful when editing this file and don't screw up your syntax. To edit it do sudo nano /etc/default/grub, then use arrows to move to the quiet splash entry and change it to "", then press Ctrl + o, then press Enter, then press Ctrl + x.

  6. This is entirely my opinion and personal recommendation but it seems like you just installed a whole bunch of clutter. Always remember that the more things you install the slower it will be, every service adds more time to boot, RAM and CPU context switching. Only install the stuff you really want and are really going to use, don't just install everything just because it's free and available.

Just some considerations and ideas, things I usually do, hope it helps.

  • 1
    Can't you just press Esc to hide the startup logo? – simplegamer Aug 25 at 17:43
  • I'm actually not sure, you probably can. But doing it the way I described will hide it during boot as well as shutdown and won't require you to press anything. – Matriarx Aug 25 at 21:49
  • 2
    snap is not that awesome as you think. sure, it has it's advantages but it's poorly documented, leaves a lot of clutter on your system when you remove a snap and you don't clean up manually. I've only three snaps installed on my system, but 14 loop-devices for snaps are mounted at boot. Taking that in count, it doesn't sound as if OP installed a ton of things. – mook765 Aug 25 at 21:57
  • I personally also don't use snap and a lot of it is still beta and many applications aren't working, or just totally violate privacy permissions. But this answer wasn't meant for advanced users, it was aimed at someone who clearly stated they are new to Ubuntu and still learning, in which case snap is awesome for someone getting used to Linux from a previous Windows/Mac App system. From the list shown the OP clearly installed Nginx and VirtualBox among many others, which all slow down your startup. Also 50+ dev loops is ridiculously high, so no, OP did install a bunch of stuff. – Matriarx Aug 26 at 14:49
1

Around 1 year ago on Debian 9 I had a 50% performance decrease on gcc compilation. Page Table Isolation caused this, it has something todo with Spectra/Meltdown. You could add -no-pti from grub on startup. Note that this was on a Haswell i7 and only when using 32 bits Linux, on 64 bits there are is no such big performance decrease.

Are you using 32 or 64 bits?

  • 1
    This does not appear to be an answer. If you intended to answer the question, please edit your answer to include the steps needed to apply your solution. For example, how to add -no-pti from GRUB on startup, if this is the answer. As a new contributor, you may want to visit our help pages to gain understanding about our Q&A format. – Nmath Aug 26 at 16:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.