Slashdot Mirror


How To Speed Up Linux Booting

An anonymous reader writes "A common complaint about Linux is the amount of time the operating system takes to start. Like Linux itself, there are plenty of options and lots of flexibility for boot-time optimization. From dependency-based solutions like initng to event-based solutions like upstart, there's an optimization solution that should fit your needs. Using the bootchart package, you can dig in further to understand where your system is spending its boot time to optimize even more."

16 of 301 comments (clear)

  1. -1st post by Looce · · Score: 5, Funny

    My Linux setup is so optimised that this first post is actually made before opening Firefox and typing slashdot.org.

    Ha!

    1. Re:-1st post by Looce · · Score: 5, Insightful

      Not really. Not even mozilla.org either. That would be about:blank.

      I don't need to download a page every time I start my browser, render it and slow it down, then replace it immediately with another page I want to visit. That's another part of system optimisation, and it avoids unnecessary strain on slashdot/mozilla/other servers, too.

  2. Boot time not an issue. by AmIAnAi · · Score: 4, Interesting

    I thought one of the arguments for linux was that you didn't need to reboot - like you do with Windows. So the boot time should not matter :-)

    --
    Any sufficiently advanced bug is indistinguishable from a feature.
    1. Re:Boot time not an issue. by nbannerman · · Score: 4, Insightful

      I guess the point is that we *should* be switching our machines off whenever possible as opposed to leaving them running for no reason. The home user isn't going to be persuaded by Linux if he/she has to wait a long time to actually get a computer into a usable state*.

      To be fair, my Windows box boots pretty quick; I think the time between power on and desktop is somewhere in the region of 50 seconds. The method of loading the core services - desktop - additional services at least gives the impression of speed, even through the disk continues to thrash for another 45 seconds as applications load in the background.

      * Jokes about Windows never being usable even after booting can be inserted here as required! ;)

    2. Re:Boot time not an issue. by arth1 · · Score: 5, Interesting

      Indeed. The boot time of a system you boot once a year is rather irrelevant.
      Laptop, you say? Hibernate, don't boot!

      What's more interesting is to reduce the login time and start-up time for applications. prelink is your best friend here. Make sure that all your apps are compiled for position independent code (PIC), and prelink them. Lots of time saved, at the expense of larger binaries.

      Regards,
      --
      *Art

    3. Re:Boot time not an issue. by Micah · · Score: 4, Interesting

      In my Kubuntu Feisty install, Hibernate takes about as long as shutting down and starting it back up about as long as a normal start.

      Of course, all the apps are still there so that helps. But it's not nearly as efficient as, say, a Mac where you can close the lid any time, open it back up again and have it right there in 2 seconds.

    4. Re:Boot time not an issue. by Bert64 · · Score: 4, Interesting

      But as you said, for the first few minutes after boot, windows is thrashing the disk and running slower... Sometimes it even does ridiculous things, like closing the start menu while your trying to select something from it, or ignoring some mouse clicks.
      You could make linux start in the same way, modify the init scripts to start XDM first, and everything else later, in which case you'd have the same appearance of fast booting.

      --
      http://spamdecoy.net - free throwaway anonymous email - avoid spam!
    5. Re:Boot time not an issue. by Columcille · · Score: 5, Informative

      suspend to disk = hibernate, suspend to ram = sleep. Sleep uses the battery, hibernate doesn't. Granted sleep mode doesn't use much, but it isn't altogether negligible. If you don't want to use any power while moving around, hibernate is the way to go. Perhaps that's his scenario.

      --
      I love my sig.
  3. Fixed in Gentoo by Wonko+the+Sane · · Score: 5, Informative

    in /etc/conf.d/rc:

    rc_parallel_startup="yes"

    (actually that should be in caps, but the lameness filter doesn't like it)

  4. Customize the Bootscript, Trim the Fat by Old+Duck · · Score: 5, Interesting

    Most bootscripts are very generic in that they will try to load all sorts of RAID drivers, various services that are not needed, special fonts, etc.. I've gone in on my computers and wrote a very simple, quick, and to-the-point bootscript (easy to do with a little BASH knowledge), and my system boots up remarkedly fast. Granted, my bootscript isn't very portable, but one of the benefits of Linux is the ability to customize it.

    Another trick is to prelink files and let KDE (if that is what you use) know about it. Even the startkde script can be long and drawn out, so trimming the fat and only including what's needed on your system can make a big difference. I've shaved over 13 seconds off a boot sequence by writing a minimum bootscript for my hardware, and that was using a relatively fast distro to start with.

    -Mike

    --
    There are more things in heaven and earth, Horatio, Than are dreamt of in your philosophy.
    1. Re:Customize the Bootscript, Trim the Fat by Wonko+the+Sane · · Score: 4, Informative

      You can fix those yourself. For any service in /etc/init.d you can put a file of the same name in /etc/conf.d. Among other things, that file can list dependencies.

      DEPEND="foo bar"

  5. Ubuntu already uses Upstart by wile_e_wonka · · Score: 4, Informative

    When I went out to take advantage of the article's suggestions, I found that, according to this thread in the Ubuntu Forums that Ubuntu 6.10 already uses Upstart.

    I did used the "profile" command in my bootup once, after reading about it in another article recently. So I guess my Ubuntu is booting about as fast as it can (unless I have useless processes starting up. I'm still trying to figure that out--I'm a noobie).

  6. Re:Popular FUD. by Nicopa · · Score: 4, Insightful

    The world doesn't end just near your nose. You may have a laptop and you may be happy with "hibernating" it, but many of us need to power off PCs. An office PC I power on every day, my home's PC I power on and off when I get and leave home.

    And it's your comment the one that is insulting. You insult lots of experienced Linux users who do care about their machines booting several times slower than an XP pc.

    And why is that? Because Linux boots up with a slow and serialized process, in which the whole system (with hyperthreading, gigs of ram, dual core, etc.) sits idel waiting for a single stupid syslog daemon to start, or worse: waiting for a DHCP client to get an IP address!

  7. Re:Popular FUD. by Silver+Sloth · · Score: 5, Funny

    12:47:33 up 65 days, 15:12, 21 users, load average: 1.20, 1.50, 1.61 21 users on a laptop? Doesn't it get a bit crowded around the keyboard?
    --
    init 11 - for when you need that edge.
  8. Re:An Uninformed Question by Goaway · · Score: 4, Informative

    Comparing fresh Linux and XP and OS X installs, Linux is by far the slowest to boot. If your school's XP installs boot slowly, they are probably doing a lot of work like transferring lots of data over a slow network connection.

  9. Boot times don't bother me by DoctorPepper · · Score: 4, Funny

    Because I only reboot my computers when I have to, like when I get an update to the kernel. The rest of the time, they just waste electricity and CPU cycles, and generate excess heat my A/C unit has to deal with! :-)

    --

    No matter where you go... there you are.