Announcement

Collapse
No announcement yet.

A Two-Second Boot Time With systemd

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • A Two-Second Boot Time With systemd

    Phoronix: A Two-Second Boot Time With systemd

    Lennart Poettering has written a guide for optimizing systemd to the extent that a two-second boot-time or less for this popular free software project...

    http://www.phoronix.com/vr.php?view=MTEwMjc

  • #2
    yep!
    Code:
    $ systemd-analyze time
    Startup finished in 1290ms (kernel) + 5834ms (userspace) = 7125ms
    And this is even with serious services running:
    Code:
    $ systemd-analyze blame
      2449ms mysqld.service
       966ms netfs.service
       793ms NetworkManager.service
       689ms opt.mount
       621ms nxserver.service
       518ms chronyd.service
       505ms httpd.service

    Comment


    • #3
      Well, default systemd:


      But aside from that, starting KDE still takes 5+ seconds, even with an SSD. So what's the point for desktop distributions in extremely fast booting when the desktop environment still takes multiple times the boot times to start up?

      Comment


      • #4
        Originally posted by cygn View Post
        yep!
        Code:
        $ systemd-analyze time
        Startup finished in 1290ms (kernel) + 5834ms (userspace) = 7125ms
        And this is even with serious services running:
        Code:
        $ systemd-analyze blame
          2449ms mysqld.service
           966ms netfs.service
           793ms NetworkManager.service
           689ms opt.mount
           621ms nxserver.service
           518ms chronyd.service
           505ms httpd.service
        How about on older computers? A single core P4-HT? A 1ghz Duron?

        I think it's great either way, but I didn't see any target system mentioned and my curiosity is raised.

        Comment


        • #5
          Originally posted by ChrisXY View Post
          But aside from that, starting KDE still takes 5+ seconds, even with an SSD. So what's the point for desktop distributions in extremely fast booting when the desktop environment still takes multiple times the boot times to start up?
          Um, if my math serves me correctly - your bootup time would be 7 seconds.

          Which is sweet. Much better than what we have today, no?

          Besides, you should see what Martin Graesslin is up to:

          http://blog.martin-graesslin.com/blo...p-performance/

          Comment


          • #6
            Originally posted by halfmanhalfamazing View Post
            Um, if my math serves me correctly - your bootup time would be 7 seconds.
            Which is sweet. Much better than what we have today, no?
            With standard systemd and e4rat with a rotational hard disk my boot was pretty much completely I/O bound. I now use an SSD and in my graph I see very few seconds for the actual boot. psd.service is "profile-sync-daemon" and it copies my firefox profile in a tmpfs. So once the overwhelming majority of my boot time is I/O.

            Comment


            • #7
              ChrisXY, if you use the nvidia drivers, it delays X startup by 4 seconds. Could this be extending your KDE startup times?

              I was wondering because on my parents machine (an AMD A6-3500 based system) KDE starts up in about 2 seconds, whereas my old Dell notebook starts KDE in about 8 seconds, and I found half the time it is just waiting for the Nvidia driver to initialize something.

              Comment


              • #8
                open source radeon driver, but my .kde4 is 116M and .local/share/akonadi/ is 283M.

                Comment


                • #9
                  Originally posted by ChrisXY View Post
                  open source radeon driver, but my .kde4 is 116M and .local/share/akonadi/ is 283M.


                  wow!

                  Comment


                  • #10
                    I've just read the tips for making systemd booting faster. ATM, I use it as my default init program. Unfortunately, it seems some tips mentioned in the FreeDesktop-related site apply only for Fedora, excluding other linux distros...

                    Simultaneously, I don't understand why using a bloated DE such as GNOME 3 / KDE 4 can make systemd faster (are there any specific optimizations for those DE's that exist on systemd code?). ATM I use Openbox and I don't have any of the *kits (ConsoleKit, PolKit, etc.) enabled. Btw, my Core i7 system loads in less than 5 seconds...

                    Cheers

                    p.s.: The systemd tips btw, are great for those who think that systemd is bloat, which is not, btw...

                    Comment


                    • #11
                      Two seconds... Well, that beats my 30-something second boot. And that's not counting the BIOS and GRUB loading times, which would bring the number close to a minute.

                      It would indeed be interesting to see how it works on other distros. How do you get a list of all boot scripts that are active?

                      Comment


                      • #12
                        Originally posted by halfmanhalfamazing View Post
                        Um, if my math serves me correctly - your bootup time would be 7 seconds.

                        Which is sweet. Much better than what we have today, no?
                        Debian stable here: 7.57 sec for init (another 9.5 sec for KDE)
                        He has 5.8 sec with systemd
                        I remember Gentoo's OpenRC to be in that range too, as long as you use ramfs.

                        It's better, but let's keep it realistic.

                        2 second init is nice, but it's not the major reason for switching to systemd.

                        Comment


                        • #13
                          Gents, many of the suggestions in the article apply only to appliances and fixed-purpose systems. They do not apply to general purpose computing desktops.

                          First Examples:
                          1: No LVM
                          2: No disk encryption
                          3: No SELinux

                          These three items need a suitable replacement. Disks should be encrypted. Program execution execution needs some form of sandbox. I don't want to say the author is wrong, I would just like to see alternatives offered. As is, all we have is "Linux boots really fast if you disable all sorts of things and adversely affect the security of your system". The first retort that comes to mind is "Duh".

                          4: No syslog and auditing. Saying that the journal "is usually more than sufficient for desktops" is.... a short sighted overstatement.
                          5: No cron? I'd really have to see if systemd is a suitable replacement. He 'might' be right that you can replace many cron-instanciated startup executables with systemd. Cron will still need to be used for more advanced scheduling, and it's startup can be delayed until after boot.

                          Perhaps the author, in time, will be correct. Unfortunately, we need lighter and faster (starting) alternatives for the first three. A smarter alternative may be to work towards decreasing the startup performance penalty of LVM/Encryption/SELinux.

                          F

                          Comment


                          • #14
                            Originally posted by ChrisXY View Post
                            But aside from that, starting KDE still takes 5+ seconds, even with an SSD. So what's the point for desktop distributions in extremely fast booting when the desktop environment still takes multiple times the boot times to start up?
                            The bootchart in the article shows booting from kernel to complete XFCE desktop in less than two seconds. KDE is bit heavier of course but it could definetly benefit from systemd if the startup script were to be ported to use it. Something like that is probably going to be used in Plasma Active as Mer uses systemd so it might not take that long to come to desktop... or at least I hope so.

                            Originally posted by ChrisXY View Post
                            2 second init is nice, but it's not the major reason for switching to systemd.
                            I would say that nearly instantaneous boot is pretty damn compelling. Of course many of the other systemd features are even more insteresting but still... If Windows 8 is getting ~10s boot then we can do it five times better. Sounds good to me.

                            Comment


                            • #15
                              Originally posted by Teho View Post
                              I would say that nearly instantaneous boot is pretty damn compelling.
                              It's not a near-instantaneous boot, it's a near-instantaneous init.

                              Boot goes like this:

                              BIOS
                              GRUB/lilo
                              Kernel
                              init <------ this is the part that was cut down from 7 seconds to 2 seconds
                              X initialisation
                              KDE/GNOME

                              The whole boot process is still much longer than 10 seconds.

                              It's still impressive work, but some of the comments here are misleading. This is only a part of the boot process.

                              Comment

                              Working...
                              X