Slashdot Mirror


Booting Linux Faster

krony writes "IBM's DeveloperWorks explains how to decrease boot times for your Linux box. The concept is to load system services in parallel when possible. Most surprising to me is the use of 'make' to handle dependencies between services." The example system shown is able to cut its boot time in half, but the article stresses the effectiveness can vary widly from machine to machine.

16 of 625 comments (clear)

  1. Just turn off services you don't need by Anonymous+Crowhead · · Score: 5, Informative

    I did that on an old slow laptop, and it cut the boot time quite a bit. There is plenty of stuff that you might not need to run like kudzu, lpd, portmap, sendmail, sshd, or clock syncing stuff.

  2. Other things to speed up boot time by epiphani · · Score: 5, Informative
    These may seem obvious, but if you're after a quick boot, try doing these things:

    • Recompile the kernel with bare essentials only - monolithic.
    • Turn off non-essential non-inetd services.
    • Tweek your rc.d scripts to get rid of things like modprobe calls.
    • Dont boot directly to xdm if you dont have to.


    Personally, I dont give a shit about how long my linux machines take to boot up, because they dont go off once they're up.
    --
    .
  3. Serel by ensignyu · · Score: 5, Informative

    Serel does this too, for RedHat and Debian. It actually works; it's not just a proof-of-concept, although it does have a number of bugs.

    1. Re:Serel by gmhowell · · Score: 4, Informative

      It may not be a proof of concept, but it seems to be a beta that hasn't been touched in a year. And debian packages (on the site I looked at) aren't available, only rpms.

      Still, looks nifty.

      --
      Jesus was all right but his disciples were thick and ordinary. -John Lennon
  4. Re: "you only need to boot it up once" by vlad_petric · · Score: 4, Informative

    I'm afraid that if you have a laptop, boot time is quite important. Doing suspend/resume with X running is not reliable. While I certainly agree that fixing this is the long term solution, a quicker boot-up is a reasonable fix in the meanwhile

    --

    The Raven

  5. netbsd rc.d by Fritz_the_Cat · · Score: 5, Informative

    I'm surprised someone hasn't pointed this out already. NetBSD's rc.d.has had support for dependencies for sometime.
    http://www.netbsd.org/guide/en/chap-rc. html

    Additionally, there's an article here. http://www.daemonnews.org/200108/rcdsystem.html

  6. Re:This is actually important by John+Hurliman · · Score: 4, Informative

    A lot of comments also missed a major platform, laptops.

    I've been furiously tweaking out my Averatec to get the quickest possible bootup (and shutdown); everything from a highly customized 2.6.0 kernel, to experimenting with software suspend and custom startup scripts. Right now I have my system booting the bare bones necessary services to get me in to X so I can turn the laptop on and fire up OpenOffice in class. The rest of the service launching is done with a shell script that I call after booting if I want to do more, like get on the net, use Samba or print.

  7. Apple did this in Jaguar by tim1724 · · Score: 4, Informative

    One of the things Apple did in Jaguar to speed up Mac OS X booting was to start services in parallel.

    Apple uses a different startup script system (see the references below) than other UNIX flavors, but it's a really cool system. It uses dependency information rather than carefully-assigned integers to determine load order, so when they decided to add parallel service starting it was easy .. the dependency information was already there.

    I'd love to see Linux or *BSD distributions adopt this system, as it's really cool to type SystemStarter start foo and have it automatically load all the dependencies for foo before starting foo itself. Plus adding services means just copying a directory into place .. no worrying about making links in /etc/rc?.d or getting the ordering right.

    Relevant documentation:

    --
    -- Tim Buchheim
  8. Been there, done that by CausticWindow · · Score: 3, Informative

    Pah. Mac OS X have done this since 10.2.

    The large question is "how do you specify inter dependencies?" The article uses makefiles. In Mac OS X Jaguar, each startup item has a properties file (associative array, the indexes are strings) that lists the item and defines all the other parts that it depends on. Thereafter SystemStarter makes a dependency tree and starts them up in parallax whenever possible or when it feels like.

    --
    How small a thought it takes to fill a whole life
  9. Nostalgy by Peaker · · Score: 3, Informative

    I have started a discussion on Debian Devel about this quite a long while ago.

    It sure is nice to see that my idea is being implemented...

    However, as others mentioned there are quite a few problems with this approach.

    One, is that it is very difficult to use make to perform the reverse (shutdown) using the same input data as the boot.

    Another problem, one that I had no time to solve, and seems to not be addressed at all by the article, is that running services in parallel also logs things in parallel. Intermixed logs are quite unfriendly to read.

    The plan a few of us at Debian Devel devised was a mini-text-window-manager for the output logs, but noone got around to implementing it.

    Lastly, the most serious problem with this approach, was legacy support. Inserting this system into Debian, at least, required that all service package maintainers provide extra dependency information about their packages. This problem was the least feasible to solve.

    Thus, my little project died then - and seems to now be revived by IBM :)

  10. That's exactly what I wrote minit for by Fefe · · Score: 5, Informative

    See www.fefe.de/minit/ for info about the project.

    It's a tiny statically linked init that besides offering make-like dependencies to load services in parallel also offers ways to avoid spawning a thousand shell and utility processes in the boot process.

    On my notebook, it takes less than a second from the start of init to a login prompt. In fact the latency is so small that I have never used the APM or ACPI suspend mode any more, I just turn the notebook off and on again. That's actually faster than the BIOS suspend-to-disk feature.

    minit also has other benefits over standard init: you can ask init for the PID of services like sshd without PID files and thus even on read-only media like a CD-ROM without initial RAM disk or shmfs.

    It's Linux only, though. And you need the diet libc for full effect (52k memory footprint for init on my desktop, including shared read-only pages).

  11. I've been doing it since 1999. by pr0ntab · · Score: 5, Informative

    My first linux Mandrake box, I went through and parallelized my rc directories. The trick was to have fake S** entries that spawn off what can be done in parallel.

    Albeit makefile based (done by hand), but I was getting my boot times down to 23 seconds on an aging Pentium MMX, with tons of unnecessary services. (I know better know, :-P)

    Too bad there wasn't any way I could have done that to Windows 98. It was a DOG!

    XP is much better, but it doesn't boot much faster than that fast on my new box even today.

    --
    Fuck Beta. Fuck Dice
  12. Richard Gooch's method by ldamerow · · Score: 3, Informative

    Richard Gooch published an interesting implementation of parallel init scripts almost a year ago: http://www.atnf.csiro.au/people/rgooch/linux/boot- scripts

  13. Re:Predicted response by AstroDrabb · · Score: 5, Informative

    This isn't true. I am one of the moderators for Red Hat @ yahoo and I am very active in Linux @ Yahoo. Join up. We are very kind over there. We only ask that

    1. No top posting
    2. No broken mailers that don't thread well (Outlook/OE)
    3. Learn to search www.google.com.

    I never see people getting into flame wars. The same thing goes for most LUGS. Come to one of the Yahoo groups and join up : )

    --
    If Tyranny and Oppression come to this land,
    it will be in the guise of fighting a foreign enemy. -James Madison
  14. Re:Make? by Webmonger · · Score: 3, Informative

    Actually, Makefiles don't have to be single monolithic files. GNU make supports the include command, which takes wildcards.

    So in MakefileRC5, "include /etc/makerc5.d/*" would include all the makefiles in the specified directory. Such makefiles would be lpd.mk and ntpd.mk, etc.

    I think that might actually work!

  15. Use the Power Save features by billstewart · · Score: 3, Informative

    For the last N years, laptops have had a sleep/wakeup power-save feature. For the last N-2 years, it's generally worked well enough to be worth using all the time :-) Linux probably knows enough about power management for it to work on most laptops by now. Instead of shutting the machine down and rebooting it, you just close the lid and it saves its status and goes into some standby mode, and when you open the lid it wakes up again, where it left off, no need for reboot. On some machines, it also succeeds in doing this when the battery gets below X%.

    --

    Bill Stewart
    New Fast-Compression-only CPR http://preview.tinyurl.com/dy575ks