0

I notice how my Ubuntu 18 boots very slow, so much slower than Windows that previously installed on the same machine. I don't use dual-boot, my machine is :

Ubuntu 18.04.3 LTS
Intel® Core™ i7-7700HQ CPU @ 2.80GHz × 8 
64-bit, NVIDIA GeForce GTX 950M

NVIDIA was quite problematic and causing boot issues, so I had to put some kernel boot parameters. Now it looks like this :

 GRUB_CMDLINE_LINUX_DEFAULT="quiet splash pci=nomsi pci=noaer
 acpi_enforce_resources=lax intel_pstate=disable acpi_osi=!Windows
 2012"

The default booting time is : 47s.

enter image description here

I followed suggestion from this post : How to diagnose/fix very slow boot on Ubuntu 18.04, while some answers helped other people, it doesn't work on me.

What I have tried :

  1. Added noresume parameter in kernel boot. Literally from the post above, someone cut booting time by 31s !

    I upgraded to 18.04 yesterday and I had the same problem (it took 52 seconds to boot). After setting the "noresume" parameter, it took 21 seconds.

    Result : (sorry forgot to take a screenshot): 57s (10s slower). Why ?

  2. Decrease time process for Network and configuring the timeout for Start Job and Stop Jobs by changing :

    /etc/systemd/system/network-online.target.wants/networking.service
    

    Change TimeoutStartSec=5min to TimeoutStartSec=5s.

    Also,

    /etc/systemd/system.conf  
    

    change :

    DefaultTimeoutStartSec=5s
    DefaultTimeoutStopSec=5s
    

    Result : Failed to boot. (Stuck at booting screen)

  3. Disable Networking during booting :

    systemctl disable NetworkManager-wait-online.service
    

    Result : Booting time was 51s (4s slower).

enter image description here

Why did I miss from steps above ? How did my machine ended up booting slower ?
Why did noresume which was supposed to prevent resume partition makes it slower instead ? Any other advice to decrease booting time ?

UPDATE

Following suggestion from WinEunuuchs2Unix, I tried :

  1. Disable networking as in step (3), and remove the journal flush service and vacuum it by changing :

    nano /etc/systemd/journald.conf
    

    change

    Storage=auto
    SystemMaxUse=50M
    SystemMaxFileSize=1G
    SystemMaxFiles=5
    

    My original journal disk usage was 2G, now it's down to 200MB. But system-journal-flush.service time doesn't seem to get faster, it's still 11s.
    Also, before changing its settings, flushing time was 3.xx s. Now it's 10.xx s instead.

enter image description here

Result, booting time : 52s (5s slower).

enter image description here

  1. Disabling tor-service :

    /etc/default/tor    
    

    change to RUN_DAEMON="no" and run

    sudo systemctl disable tor.service
    

    Then added video=SVIDEO-1:d parameter to the boot kernel (following solution from : Long Kernel Boot Segment in 18.04).
    And masked systemd-journal-flush.service and the keyboard-setup.service (following solution from : Long boot time Ubuntu 18.04).

Result. Booting time : 45s. (2s faster), but I believe it can be improved.
On the second trial : 47s (no improvement).
I really thought disabling tor-service would give me 5~7s faster booting time since it originally took 10-13s in booting time.

enter image description here

Still confused at how noresume parameter, disabling networking and vacuum logs from journal lead to slower booting time instead. Further suggestions will be appreciated !

UPDATE 2

  1. Install haveged. Booting time : 49s (2s slower)

enter image description here

Just why.

raisa_
  • 281
  • Can go though line by line and google which services are safe to disable at start up. Can also remove snapd, but some apps are only available as snaps now. Will also need to replace some removed snaps with deb versions. I don't have enough knowledge to tell you which are safe to remove or disable. – crip659 Dec 12 '19 at 22:22
  • @crip659 Yes, I'm aware snap can slow down my machine as well, but I need snap on my system. I'm currently checking each service, thanks. – raisa_ Dec 13 '19 at 07:57

1 Answers1

0

You can probably disable network waiting altogether:

Remove the journal flush service and vacuum it instead:

Slow snapd times can be sped up by jiggling your mouse at boot time:

  • I wasn't aware of the journal logs stuff, thanks I learned something new ! I've updated my question, I tried combination of your suggestions : disabling networking + vacuum journal logs + moving mouse & touchpad. Result booting time : 52 seconds (still 5 seconds slower). I see in blame that tor-service is taking up 13 seconds, I'm gonna try to disable that. But I'm still confused at how noresume, disabling network and vacuuming logs make it slower instead. – raisa_ Dec 13 '19 at 10:24