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. Predicted response by Anonymous Coward · · Score: 5, Insightful

    "Who cares how long it takes to boot Linux? My uptime is 400 days!!!"

    Yup.. just keep talking about that and wonder why Linux never becomes mainstream.

    1. Re:Predicted response by Crispy+Critters · · Score: 5, Insightful
      "This is the current state of the Linux community."

      No it isn't. I am on a local LUG mailing list, and people are politely helping newbies all the time, going out of their way to explain things that weren't even asked, just in case it might help.

      "Not only the case on Slashdot, but go to any IRC help channel and you'll find the same the majority of the time."

      IRC and /. were not exactly designed for thoughtful interaction.

    2. Re:Predicted response by Trepalium · · Score: 5, Insightful
      In order for him to get a straight answer he had to pre-emptively insult himself "Guys, I know I'm entirely retarded, but does anyone know how to get mplayer to play X?"
      Uhm, so you think that just because someone insulted himself during the post means that everyone who might provide you with free technical support on Linux is a prick? Hate to break this to you, but that's hardly Linux's fault. Regardless of what you look for support on, you'll find idiots who want to give you snide comments like RTFM, or go do it yourself. My experience is that most people will try to help you provided you show that you made some effort to solve the problem yourself (such as state what you tried that didn't work).

      Lets assume that you call a vendor for support. You'd likely to have paid for the support, so the vendor will likely allow you to be somewhat abusive of their support personelle because the money you pay them is worth the inconvenience. Now, most of the support you get on newsgroups is by people not getting any income for answering your questions, so their tolerance to put up with crap is significantly decreased. If you even ask a question in such a way that makes you look like you might be one of the assholes they deal with in the support business, you will be dropped as quickly as possible. When you want something for nothing, being polite and courteous versus appearing to bark out demands is the difference between getting an answer, and getting "RTFM". BTW, this applies equally to proprietary software lists (unmanned by paid employees) as to free software lists. Lists and discussion groups with paid employees answering questions (such as microsoft.public.*) can be friendlier, but you get boilerplate responses more often, and the same answer three times over before someone finally gets that their solution doesn't work for your problem.

      --
      I used up all my sick days, so I'm calling in dead.
    3. Re:Predicted response by ftzdomino · · Score: 5, Funny

      What really sucks is the 497.1 day uptime rollover bug. Apparently it has been fixed, but that doesn't help us who booted before it.

    4. 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
  2. Re:Another way to speed up booting Linux by pudding7 · · Score: 5, Insightful

    Anyone ever wonder how we got ourselves into a situation where we spend so much time saving ourselves time?

  3. Make? by JohnGrahamCumming · · Score: 5, Insightful

    Most surprising to me is the use of 'make' to handle dependencies between services."

    Really? That's an odd statement. How surprising that they choose to use an open-source software application that is designed to compactly represent dependencies for representing dependencies.

    Perhaps they should have drawn Visio diagrams instead!?

    John.

  4. 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.

  5. 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.
    --
    .
  6. 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.

  7. Re:boot? by kcurtis · · Score: 5, Insightful

    > I rarely have to boot ever after the first boot and patch!

    Probably true. But one goal of linux is to become the predominant desktop/laptop OS.

    I work for a public school system. I'd rather not have all these computers eating up power all night when they're not being used.

    In most work environments, pc's get turned off over night, and sometimes even at lunch.

    This is one more way someone is helping to make Linux a better candidate for your casual end user.

  8. PowerPC Linux users had compiled boot 'scripts' by Sleepy · · Score: 5, Interesting

    This was three years or more ago, but I remember one of the PPC Linux developers "converted" all his system boot scripts in init.d to compiled C.

    Boot times went from about 2 minutes, to 35 seconds.

    (It took "so long" because it was an old PPC 601 60MHz or something like that).

    Distributions such as Mandrake and Gentoo claim they go the extra mile for "performance". I've wondered why neither has cleaned up their boot process.

    You wouldn't think Bash is slow from interactive use, but it really it. Piggyback on that speed problem that too many "functions" (OK, *commands*) are standalone executables... greate sub-process, collect result, destroy, rinse repeat.

    This is pretty interesting stuff, and I applaud this guys efforts. INIT script achitecture is pretty thankless stuff.. .no "glory". Fixing this would be like someone fixing fdisk... no one wants to touch the damn stuff...

    1. Re:PowerPC Linux users had compiled boot 'scripts' by Master+Bait · · Score: 5, Interesting
      That's a pretty good idea.
      I use a bunch of homemade Xterminals made out of Nforce boards and we have replaced /sbin/init itself with an executable shell script (and use ash for the shell instead of bash). The entire contents of init is this:
      #!/bin/sh
      /bin/cat /dev/null > /var/run/utmp
      /sbin/insmod /modules/nvnet.o
      /sbin/ifconfig lo 127.0.0.1
      /sbin/mount -o remount,rw /
      /sbin/mount -t proc /proc /proc
      /sbin/insmod /modules/nvidia.o
      /usr/X11R6/bin/X -broadcast
      /bin/sh

      No shutdown script is necessary because Xterminal users simply logout and turn them off.

      I think one of the biggest slowdowns on PCs is the lame PCBIOS which takes a very long time to run through all the hardware. I remember following LinuxBIOS development. It is so fast, that it was finished checking the computer's hardware before the disk drives finished spinning up.

      --
      "Only in their dreams can men truly be free 'twas always thus, and always thus will be."
      --Tom Schulman
  9. 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

  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