Slashdot Mirror


Reducing Boot Time On a General Linux Distro

Linzer writes "In this blog entry, Fred Crozat (head of Mandriva's engineering team in France) explains in great detail how his team has been detecting and getting rid of bottlenecks in the boot process, from the early stages to loading the desktop environment, thus decreasing overall boot time. An informative tour of the nuts and bolts of the boot process and how they can be tinkered with: initrd, initscripts, udev, modprobe calls. The basic tool they use for performance analysis is bootchart, which produces a map of process information and resource utilization during boot. The final trick: preloading desktop environment files while waiting for the user to type her password."

25 of 354 comments (clear)

  1. Interesting but how useful, really? by djh101010 · · Score: 4, Insightful

    I can see optimizing this for the sake of the geeky goodness of it and all that but, really, how often does someone reboot a Linux box, that this even enters into it? Maybe I'm unusual but mine usually stay up until there's a new version of my distro of choice to upgrade to. Time to boot just doesn't impact me very much.

    1. Re:Interesting but how useful, really? by Yvan256 · · Score: 5, Insightful

      Some people power down their computers at night.

    2. Re:Interesting but how useful, really? by LWATCDR · · Score: 4, Insightful

      Yes you are unusual.
      I shut down my work PC when I leave at night. I shut down my laptop when I put it back into the case.
      Netbooks are also shutdown when you put them away.
      Even you might shutdown your PC to save some power if it didn't take very long to power it back up.

      --
      See my blog http://ilovecookes.blogspot.com/ for light hearted technical information.
    3. Re:Interesting but how useful, really? by pm_rat_poison · · Score: 5, Insightful

      You should REALLY turn off your pc when you're not using it. Saving 30 seconds for whole hours of needless power consumption is irresponsible for the environment. Tree-hugging aside, just because you don't need to do it, it's very important for people who do need to turn off their computers, such as those who use laptops.

    4. Re:Interesting but how useful, really? by Neil+Watson · · Score: 3, Insightful

      Fast boot laptops would be a nice feature. On the server side look at Sun's SMF of Solaris 10. It boots many services in parallel. Not only does this decrease boot time but SMF knows the depencies of all services. This is useful when troubleshooting a failed service. I'd like to see this in Linux.

    5. Re:Interesting but how useful, really? by stevey · · Score: 3, Insightful

      That makes sense, but there is using a PC and using a PC.

      My main desktop machine I leave on 24x7. I might not be logged into it, but it is used to create off-site backups of some remote servers.

      So while it isn't being used by me directly, it has a job to do during the nights it is left running.

    6. Re:Interesting but how useful, really? by MyLongNickName · · Score: 3, Insightful

      dditionally I use my computer so frequently (yes I`m a true geek... if I get up in the middle of the night I`ll often check email/see whats happening on IRC.. and I tend to shell in from work frequently)

      And wouldn't that be exactly the point in reducing boot times? I shut down at night, but would be shut down more often if I could have my PC up and available in under ten seconds.

      And P.S. getting on to check your email in the middle of the night isn't the sign of a true geek. It is borderline obsessive :).

      --
      See my journal for slashdot ID's by year. Mine created in 2005. http://slashdot.org/journal/289875/slashdot-ids-by-year
    7. Re:Interesting but how useful, really? by ccguy · · Score: 4, Insightful

      Some people power down their computers at night.

      If their default linux setup doesn't complete boot-up before their finish their morning piss they have a problem that no guide will fix :-)

    8. Re:Interesting but how useful, really? by ogrisel · · Score: 2, Insightful

      Boot time is very important for laptops when the sleep / hibernate feature is not well supported, prone to crash or slower than the boot it-self.

    9. Re:Interesting but how useful, really? by chill · · Score: 2, Insightful

      On or from a desktop?

      If so, check out your BIOS to have the PC wake itself up in the middle of the night, just before your scheduled jobs kick off. Make the last scheduled job power the machine off and your problem is solved.

      --
      Learning HOW to think is more important than learning WHAT to think.
    10. Re:Interesting but how useful, really? by gfxguy · · Score: 4, Insightful

      It's so buggy that Windows doesn't have a problem with it.

      Seriously, I'm a huge Linux fan, I use it at work, I use it at home, I'm using it right now... but that's just ridiculous.

      I don't have to keep a shell window open, as there are hot keys enough to get one (I don't reboot by hitting the button), but I'm not about to spend a penny on something Windows can handle just because Linux can't.

      --
      Stupid sexy Flanders.
    11. Re:Interesting but how useful, really? by rickb928 · · Score: 3, Insightful

      This response illustrates a phenomenon my friends in the business refer to as:

      "More friendly advice from the helpful Linux community"

      Other examples include:

      "Did you read the documentation?" - Ah, usually offered in response to your post that the documentation didn't help...

      "If you don't understand this, you shouldn't be doing this" - Yes, that exaplains why Linux is so often touted as a great way to learn stuff.

      "Did you try reinstalling?" - When not offered in response to your question which includes describing repeated installations, it is offered as a rational first step, especially to kernel problems...

      "You should be using {insert other distro name here}, {insert your ditro name here} sucks" - You can count on this response immediately after a distro update, though it is also offered when you use a distro that is not one of the top 2...

      "Can you give us your {insert all manner of filenames here}?" - usually asked for in response to problems that cause panics, but also offered for problems that do, after much investigation, not have any logs. Like games.

      Sorry, but I had to blurt out another "this is not helpful" response. The fact is, some Linux machines do actually get shutdown, and for valid reasons. And the question presupposes that shutdown is a given, since the question was about startup...

      But I get where you're coming from. Many Linux users have no concept of the conditions and uses that other Linux users work within. None whatsoever.

      I rarely post helpful advice to Linux questions, mostly cause I don't have answers, but when I do I try to actually be helpful. And I usually try to be polite to those who aren't. But I slip now and then...

      It's not quite as bad as Windows advice, which varies from "reboot" to "reinstall" to "post your hijackthis logs". You have to cultivate excellent technical sites for good advice, and give back when you can.

      Oh, wait. this is /. after all... nevermind.

      --
      deleting the extra space after periods so i can stay relevant, yeah.
    12. Re:Interesting but how useful, really? by pm_rat_poison · · Score: 2, Insightful

      Oh, I'm with you on the whole "environmentalists are obnoxious" thing. But just because they're obnoxious, doesn't make them wrong...

    13. Re:Interesting but how useful, really? by AKAImBatman · · Score: 5, Insightful

      And yet, who does the average user blame? Their hardware or Linux? There is a certain threshold beyond which arguing is pointless. If something doesn't work, you're not hurting anyone except yourself by trying to deflect blame. (Rightly or not.) As a developer myself, that's a lesson I had to learn long ago.

      Just some food for thought.

    14. Re:Interesting but how useful, really? by Acapulco · · Score: 5, Insightful

      I'm not bashing you or anything, but I stopped doing that same thing some years ago when I thought that maybe the amount of resources saved by turning my computer off had much greater impact than a very very long-term goal like those you list.

      The thing is, even when you are indeed helping solve whatever problem you choose to participate in, in reality the design of those projects is to take advantage of the unused cycles of a PC while doing its "regular" scheduled work. That is, to maximize the usage of the PC.

      By leaving your computer on only because of the @home projects you are doing the opposite, ie. not maximixing PC usage, because you are indeed "creating unused cycles" for idle time work. I see it like trying to maximize the electricity use at home by running a garbage-burning generator (just for the sake of the example), and then "creating" garbage on purpose just to "take advantage" of it. That's not really what the original intent of the generator was and thus is not maximizing anything.

      Of course in the end it's your choice, just maybe something you could think about from a different perspective.

      --
      Slashdot. Unreadable news to annoy nerds. - wonkey_monkey
    15. Re:Interesting but how useful, really? by Blakey+Rat · · Score: 1, Insightful

      Oh, Woosh. It's obviously my fault that I don't recognize a random string of characters to mean "I2 Wake-On-LAN." Of course, I still don't know what the holy fuck "I2" means (again, nothing relevant in Google), so maybe you just lack the ability to communicate worth a shit.

    16. Re:Interesting but how useful, really? by pdxp · · Score: 1, Insightful

      WoW, chill out man. I was just suggesting that you learn2, or maybe "l2", use Wake-On-LAN to remote into your systems.

      It's commonly used on IRC and in MMORPG's to suggest there's something that may be obvious to others, but not yourself, that you should try in order to make your life easier.

      All you had to do the get the general meaning of my "random string of characters" via Google is to understand that I'm not referring to the Word Of Life Fellowship and direct your attention to the nearest Wikipedia entry that makes sense in the context of your comment I responded to.

      I apologize if none of this makes sense to anyone, since I apparently cannot communicate well enough to achieve the communication-worthiness of a piece of feces.

    17. Re:Interesting but how useful, really? by ToasterMonkey · · Score: 5, Insightful

      Unless your box is actually doing something useful overnight, you're wasting a lot of power leaving it switched on all the time. Never mind the tree-hugger angle, that's costing you money.

      We've had various low power/sleep/hibernate modes available for _years_ now, I think we should work on getting those features working more reliably under Linux than telling users to change their ways to suit Linux's lack of progress. For that matter, just change the fucking boot process already, see every other modern OS for examples. Solaris, Mac OS X, Vista.. and I'm sure there are others who also moved on from crusty linear execution of shell scripts.
      This is typical Linux-speak.. "It's not broke/missing, you should change."

      Go ask someone with a Mac what his boot time is. "You mean you turn yours off?"
      Try hibernating a Mac laptop. Don't know how? Close lid. Wait less than 5 seconds for blinky light. Unplug power and rip out battery. Yes, it hibernates that quick, and it's automatic.
      iMacs, desktop systems mind you, default to standby mode after 10 minutes idle. It's even smart enough to not standby a system that's streaming music or sharing files, it'll just standby when the connections are closed. OS X's suspend/resume is the most reliable out there. True, it's because of the tight integration with Apple hardware, that's what you pay for. Linux and Microsoft are at a slight disadvantage, but that's the open PC market for you, love it or hate it.

      Apple has paid particular attention to this area, but you might even learn a thing or two by looking at Vista's power saving modes. Also, Solaris has a nice streamlined boot process and replaced much of their old init stuff, you might want to check that out.

      The Linux community can't just tell it's users to change any more, there are many alternatives, and I wouldn't say anyone is asleep at the wheel anymore. It's not just Linux vs. big sleeping giant Microsoft anymore like many of you thought around 2000. There's much more out there than Windows, and even that improves leaps and bounds every generation. Linux has hurt many traditional UNIX systems, and I can think of a big one that isn't going to (and doesn't have to) cave in to Linux. Than there's Apple, which frankly, Linux can't hold a freaking candle to, but anyone who really wants Linux to succeed on the desktop needs to pay close attention to them.

      However, people aren't logical. People tend to place more emphasis on time spent waiting for the system to boot than a lot of other bottlenecks. You can argue about the reasons for this, it's an interesting psychological debate, but the fact is that it's true. Boot speed has a big psychological effect on how fast people think a system is. So, it's a good idea to optimize it.

      Logic, schmogic, are you going to let every other system outperform Linux (in the eyes of the users, or however you want to put it) because you think your users have an illogical desire for a faster booting system? Are you trying to cleverly say you're right, users are wrong, but you'll appease them anyway? Yah, that's a nice twist on "customers are always right." The customer is wrong, but I'll do it anyway because they're stupid. That's a winning attitude. This is why Linux has so much trouble.

    18. Re:Interesting but how useful, really? by kesuki · · Score: 2, Insightful

      and sometimes, the motherboard bios itself loads buggy tables when it 'detects' linux rather than using the same tables it uses for windows. causing all manner of stability problems and issues. some companies just don't care if their motherboard runs linux, they might even be taking money to make linux look bad from microsoft.

  2. Laptops by Joe_NoOne · · Score: 3, Insightful

    Well, it helps if it's installed on a laptop or on old hardware.

    Also it goes to quicker recovery time in case of outages. Coming from the Solaris world before they had journaling UFS filesystem it could take hours to FSCK a large partition before the OS would come up. On a production system that is a big deal.

  3. POST by riffraff · · Score: 5, Insightful

    My problem is not the linux distro coming up to a login prompt, but the server getting past all the cards prompts to get to the normal boot. What with scsi controller cards having their own bios, the system bios, and miscellaneous others, it can take longer to get past the post then to boot linux. The HP DL360 G5's we have can take almost 30 seconds just to starting booting the linux kernel.

  4. ACPI whitelist? by tepples · · Score: 3, Insightful

    Just be sure not to use crappy software/hardware that doesn't support [sleep].

    And pay multiple times over for return shipping when I find that one or more components of my computer don't come out of sleep properly. Or do you know of a good whitelist of makes and models of commodity PC hardware that have the fewest defects in their ACPI implementation?

  5. why bother with booting? by FranTaylor · · Score: 4, Insightful

    Why not just get hibernate to work well and do that?

    There is a lot of CPU chewed in the booting process and you can only do so much to speed it up.

  6. They Really Spent YEARS on this? by ilikenwf · · Score: 1, Insightful

    After post, I have my Archlinux based laptop booting in 11-14sec consistently. I have added a daemon or two since this bootchart, but until then I was at 12 seconds every boot. Now it's still only 14sec. I don't see how these guys call their bootcharts fast. Their athlon xp 3400 system (closest to my 3200 x2) booting in 22 secs is supposed to be fast.

  7. Re:OT Grammar Nazi comment by pbhj · · Score: 3, Insightful

    Using the pronoun 'her' instead of 'his' is as sexually discriminatory as using simply 'his' has been judged to be in the past.

    My grammar is terrible, but I do know that 'his' was used as the neutral/unspecified gender pronoun as well as the masculine pronoun (but we tend to use their now, it's what I would use) and that it has nothing to do with negative sexual discrimination.

    Those that think women are denigrated by the use of "his" (eg "If a soldier lays down his arms ...") should really wonder why they think so little of women that they might need the rules of grammar to be changed to promote them.