How to speed up your boot on Ubuntu 16.04

7,369

That system you have should be quite fast with Ubuntu. Since that processor is nearly 6 years old, the hard drive in your system is also likely close to 6 years old as well. It is probable that your hard drive is simply nearing its end of life, if you want a fast boot, invest in a ssd. You should be able to achieve 80-160 MB/s(sequential read/write) on a good hard drive (hdd not a ssd). A ssd however, can achieve speeds up to 500MB/s

Share:
7,369

Related videos on Youtube

Michelangelo
Author by

Michelangelo

Updated on September 18, 2022

Comments

  • Michelangelo
    Michelangelo over 1 year

    I have installed Ubuntu 16.04 but at the moment it needs 2 minutes and 35 seconds to be ready .... :o

    Ubuntu 16.04 LTS

    $ uname -a
    Linux mycomputer 4.4.0-36-generic #55-Ubuntu SMP Thu Aug 11 18:01:55 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
    

    This is my configuration:

    • CPU Intel Core i5-2500K 3.30GHz
    • 8GB RAM DDR3 Geil Value Plus
    • Hard Disk Interno Western Digital Caviar Green 500GB

    How to improve my Ubuntu load time process?

    • Preload
    • Prelink
    • swappiness = 10

    97s to load

    Update: This is a developer box. I am using it to software development, php software, Virtualbox is useful to test the software in MS windows enviroments.

    Updates

    I have deleted all too much time spent ! In a fresh install I have installed the preload, fixed the swappiness and I have installed the bootchart.

    Fresh install

    $ systemd-analyze critical-chain
    
    graphical.target @41.346s
    └─multi-user.target @41.346s
      └─apache2.service @32.909s +8.436s
        └─network-online.target @32.893s
          └─NetworkManager-wait-online.service @17.777s +15.116s
        └─NetworkManager.service @13.330s +4.436s
          └─dbus.service @11.561s
            └─basic.target @11.559s
              └─sockets.target @11.559s
                └─snapd.socket @11.509s +44ms
                  └─sysinit.target @11.471s
                    └─apparmor.service @3.406s +8.064s
                      └─local-fs.target @3.406s
                        └─run-user-1000.mount @38.169s
                          └─local-fs-pre.target @3.396s
                            └─systemd-remount-fs.service @3.332s +52ms
                              └─systemd-journald.socket @1.067s
                                └─-.mount @1.066s
                                  └─system.slice @1.067s
                                    └─-.slice @1.066s
    
    $ systemd-analyze blame
        16.650s mysql.service
        15.116s NetworkManager-wait-online.service
        8.436s apache2.service
        8.064s apparmor.service
        7.246s ModemManager.service
        7.095s dev-sda1.device
        4.436s NetworkManager.service
        4.075s accounts-daemon.service
        3.334s lightdm.service
        3.095s gpu-manager.service
        2.367s grub-common.service
        2.239s ondemand.service
        2.027s rsyslog.service
        1.959s networking.service
        1.948s thermald.service
        1.880s plymouth-start.service
        1.571s polkitd.service
        1.527s brltty.service
        1.397s systemd-tmpfiles-setup-dev.service
        1.386s systemd-tmpfiles-setup.service
        1.372s systemd-modules-load.service
        1.323s systemd-journald.service
    

    LAMP Boot

    NEW UPDATE! I have bought a new Samsung SSD Hard Drive and now the boot requires about 15 seconds!!! but I am not so happy because I have seen the new bootloader chart and I have discovered that the NetworkManager-wait-online-service requires about 8 seconds to be online! How to solve this issue?

    SSD bootchart issue

    FINAL UPDATE: This is the complete hardware configuration:

    Processor: Intel Core i5-2500K @ 3.70GHz (4 Cores), 
    Motherboard: ASRock H67DE3, Chipset: Intel 2nd Generation Core Family 
    DRAM, Memory: 32768MB, 
    Disk: 250GB Samsung SSD 850, 
    Graphics: HIS AMD Radeon HD 6870 1024MB, 
    Audio: Realtek ALC892, 
    Monitor: SyncMaster, 
    Network: Realtek RTL8111/8168/8411
    

    Now I have upgraded the RAM from 8GB to 32GB! After the installation of the SSD, my pc freeze until the normal using.

    • Preload
    • Prelink
    • swappiness = 0 (you don't need to use the swap partition)

    The boot now is falling down to 9s as show in this bootchart image:

    Upgrade to 32GB - Bootchart

    $ systemd-analyze critical-chain
    
    graphical.target @5.756s
    └─multi-user.target @5.747s
      └─apache2.service @4.461s +1.285s
        └─network-online.target @4.460s
          └─NetworkManager-wait-online.service @1.447s +3.013s
        └─NetworkManager.service @1.344s +93ms
          └─dbus.service @1.006s
            └─basic.target @999ms
              └─sockets.target @999ms
                └─snapd.socket @991ms +3ms
                  └─sysinit.target @988ms
                    └─apparmor.service @372ms +596ms
                      └─local-fs.target @365ms
                        └─run-user-1000-gvfs.mount @2.621s
                          └─run-user-1000.mount @2.234s
                            └─local-fs-pre.target @365ms
                              └─systemd-remount-fs.service @352ms +7ms
                                └─systemd-journald.socket @118ms
                                  └─-.slice @116ms
    

    New Configuration

    Thanks

    • Melebius
      Melebius over 7 years
      Is the machine intended as a server (apache2, mysql, postfix services being started)? I’d not install GUI in such a case.
    • Ben
      Ben over 7 years
      It can have many reasons...It also depends on your autostart services and maybe something like wait for Network-Settings...My Ubuntu x64 16.04 is ready (incl. GUI) in below 30 secs. (AMD FX 8150 + 16GB + SSD) for example....
    • Melebius
      Melebius over 7 years
      @Ben OP does not use an SSD. This is a huge difference.
    • Ben
      Ben over 7 years
      @Melebius Yes, I just wanted to give my specs, so he has something to compare when he asks Is my system fast?. Beside that, before I used a SSD, my boot-up time was about 50-60 secs., which is still much faster than 2:35 min.
    • Ben
      Ben over 7 years
      Look at Network-Wait-Online (15s) + MySQL(35s) in your diagram. It is correct? 35s for MySQL seems to be a long time..(depending on your configuration/db-size),same with Apache...
    • Ben
      Ben over 7 years
      I have to add to my system spec comment, that I also have a similiar service setup (MySQL, Apache, TeamViewer, VirtualBox, and some more...) Do you really need all this services? (e.g like Postfix?)
    • Michelangelo
      Michelangelo over 7 years
      thanks guys. this is a developer machine. I have edited the question to improve the description of the system. @Ben: TeamViewer has been deleted.
    • Amias
      Amias over 7 years
      best developer machine i have used is the dell precision m3800 , fast i7 , 16GB RAM , 4k screen , Nvidia Quadro m2 pcie ssd and thunderbolt 2 . There are some sweet deals in the outlet store if you can wait for a while. At the very least double the ram and get a good SSD.
    • Ben
      Ben over 7 years
      I've also a dev machine. My MySQL starts in 1.15 sec. (default config, it contains 5 DB's, each about 200 MB to - 1,5 GB Size) Why does your MySQL need 35s to start?
    • Michelangelo
      Michelangelo over 7 years
      Ok I have formatted all! I've spent too much time.
    • Michelangelo
      Michelangelo over 7 years
      look at the update!
  • Michelangelo
    Michelangelo over 7 years
    I have bought a Samsung SSD and now the boot is really very fast! thanks for the hint! by the way the boot needs a little fix. Look at the updated post above. thanks
  • user34716
    user34716 over 7 years
    Great to hear that the upgrade worked for you.