Follow Slashdot blog updates by subscribing to our blog RSS feed

 



Forgot your password?
typodupeerror
×
Operating Systems Software Linux

Reducing Boot Time On a General Linux Distro 354

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."
This discussion has been archived. No new comments can be posted.

Reducing Boot Time On a General Linux Distro

Comments Filter:
  • by djh101010 ( 656795 ) on Tuesday September 30, 2008 @11:38AM (#25205223) Homepage Journal
    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.
    • by Yvan256 ( 722131 ) on Tuesday September 30, 2008 @11:41AM (#25205265) Homepage Journal

      Some people power down their computers at night.

    • by LWATCDR ( 28044 ) on Tuesday September 30, 2008 @11:46AM (#25205331) Homepage Journal

      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.

      • by Hatta ( 162192 )

        I shut down my laptop when I put it back into the case.

        Why not use s2disk?

      • I would definitely shut down my gaming box much more often if it took less time to power up. As it is, 2+ minutes, is just annoying. I generally want a quick fix.
      • I shut down my work PC when I leave at night.

        I'm probably not at all typical, but I need to keep my work PC on so I can remote into it if clients call with problems after-hours. Or even if it turns out I need to call in sick, but still get at some of my files.

        I shut down my laptop when I put it back into the case.

        Uh, laptops have sleep mode and suspend. I can't imagine why anybody would ever shutdown a laptop unless they were going on vacation and not bringing it along. Or selling it, maybe.

    • Re: (Score:2, Informative)

      by Anrego ( 830717 ) *

      I agree...

      Maybe if I used a laptop it would be different.. but as it stands I only reboot my computer when I upgrade my kernel (which isn't often).

      What I have noticed is distro's like Gentoo boot fast because the user starts from the ground up and adds only the services they need. A default install of Debian comes with a large number of services that your average user probably doesn't need.. and probably slow the boot process.

      That's not to say Gentoo is necessarily better.. I recently decided to give Debian

    • Actually a lot if you use it as a desktop OS..
      (Hopefully) not a lot when using it as a server.
    • by pm_rat_poison ( 1295589 ) on Tuesday September 30, 2008 @11:50AM (#25205383)
      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.
      • Re: (Score:3, Insightful)

        by stevey ( 64018 )

        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.

      • by jandrese ( 485 )
        But night time is when the backups run! Not to mention all of those system maintenance scripts.
        • Re: (Score:3, Insightful)

          by chill ( 34294 )

          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.

      • As much as I would love to tree-hug, I'm also hugging a different kind of tree to better the environment by running Boinc (rosetta@home/foldit@home).

        So, by leaving my computer on, I am helping.
        • by Acapulco ( 1289274 ) on Tuesday September 30, 2008 @02:53PM (#25207849)
          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.
      • The more environmentalists tell me what the do, the more I do the opposite just out of spite. :P

        More seriously, though, my backup software (Mozy.com) runs overnight. If I turned off my PC, it'd never get backed-up. Plus Folder Sync requires both computers to be on to get synched correctly, so my laptop wouldn't get synced if my desktop was turned off.

      • by zmooc ( 33175 )

        You're probably right, but the matter is much more complex than you make it sound. The problem is that turning a computer on and off causes thermal stress and other undesirable things that affect the lifespan of your computer. Therefore, on average, turning off a computer each night will shorten its lifespan. Since manufacturing, transporting and recycling a computer costs lots of energy, this should be taken into account when determining whether turning a computer off is really good for the environment.

        Apa

    • by Neil Watson ( 60859 ) on Tuesday September 30, 2008 @11:53AM (#25205421) Homepage

      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.

    • by rlp ( 11898 )

      how often does someone reboot a Linux box, that this even enters into it?

      I guess you don't own a Linux laptop.

    • I have a linux laptop that I tote with me. I generally like to power-down when moving place-to-place to reduce HD damage if I jostle it too much.
    • I agree with you, but for some reason that's a hugely important metric that commenter, reviewers, and Slashdot posters pay attention to when new OS releases happen. So it's important from a PR standpoint, if for no other reason-- the real news here is that anybody using Linux has any conception of things that are important from a PR standpoint.

    • Re: (Score:2, Insightful)

      by ogrisel ( 1168023 )
      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.
    • A lot of people shut down and restart regularly.

      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.

      If you look at it in a logical way - how much of the time spent using a computer is spent booting - no, it's not important at all. Optimizing almost anything else is more efficient. However, people aren't logical. People tend to place more emphasis on time spent waiting for t

      • by ToasterMonkey ( 467067 ) on Tuesday September 30, 2008 @07:07PM (#25211397) Homepage

        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.

    • Re: (Score:2, Informative)

      I dual boot. Switching from Windows(gaming/schoolwork) to Linux(software development, general use) is a common thing for me.

       
    • I run linux on a laptop. Boot and shutdown times are very important when you want to start using the computer *right now* to google something/show someone a picture/remote into a server and restart apache/etc. Or in a server environment, if I do have to reboot a server, I want it to come back up as fast as possible to minimize downtime and to confirm that it's not stalled at a console prompt. Reducing perceived boot time is critical to linux' success on the desktop, and doesn't hurt at all in a server s

    • by rickb928 ( 945187 ) on Tuesday September 30, 2008 @01:53PM (#25207115) Homepage Journal

      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.

  • her? (Score:5, Funny)

    by gEvil (beta) ( 945888 ) on Tuesday September 30, 2008 @11:39AM (#25205237)
    The final trick: preloading desktop environment files while waiting for the user to type her password.

    A female Linux user?!? You can compile and install Gentoo while waiting for that to happen. : p
    • Re:her? (Score:5, Funny)

      by Anonymous Coward on Tuesday September 30, 2008 @11:56AM (#25205453)

      A female Linux user?!? You can compile and install Gentoo while waiting for that to happen. : p

      Hey! I thought I was a real woman (and people with your point of view were extinct by now)

      --
      laura.

      • Re: (Score:2, Interesting)

        by elrous0 ( 869638 ) *
        Oh, come off with the PC policing! Do you actually expect us to pretend that there is an equal distribution of males to females in the geek world of obscure Linux distros? No one's saying that there aren't ANY women into Linux, just that using the feminine pronoun is a little disconcerting in a specific area that is represented by a male to female ratio of at least 9:1.
      • Anonymous Coward is a woman?!?
      • Hey! I thought I was a real woman (and people with your point of view were extinct by now)

        --
        laura.

        Pics or you didn't happen.

      • by u38cg ( 607297 )
        I'm still waiting for the meteorite...
    • by LWATCDR ( 28044 )

      Actually my wife uses Linux. So yes a Slashdot user that is married to a woman that uses Linux.

  • howto? (Score:3, Interesting)

    by debatem1 ( 1087307 ) on Tuesday September 30, 2008 @11:47AM (#25205335)
    I see what they're getting at but not how to achieve similar gains. Anybody out there feel like putting together a slightly more practical guide?
  • by Anonymous Coward

    I am sure both Mandriva users will be very happy.

  • Laptops (Score:3, Insightful)

    by Joe_NoOne ( 48818 ) on Tuesday September 30, 2008 @11:59AM (#25205493) Homepage

    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.

  • by sbryant ( 93075 ) on Tuesday September 30, 2008 @12:10PM (#25205667)

    On my systems, it's the BIOS that takes a very large chunk of the overall boot time. As far as it goes, I think the Core2 machine takes about the same amount of time to start loading the OS as the old 486 used to.

    Having an x86_64 architecture is nice, but why oh why are we still lumbered with that legacy piece of you-know-what? I think I want a Mac Mini now, just because of that...!

    -- Steve

    • Nice Try! (Score:4, Funny)

      by BigAssRat ( 724675 ) on Tuesday September 30, 2008 @12:33PM (#25206021)
      NICE try "Steve" or is it "Mr. Jobs"? Attempting to infiltrate our "Linux discussion" with your MAC hype!!
    • by Nimey ( 114278 )

      Agree. Since Vista SP1 supports EFI boot now, maybe in a few years most consumer computers will switch to EFI instead of BIOS.

      Meantime, I wish Coreboot (formerly LinuxBIOS) worked on more motherboards. :-(

    • by Locklin ( 1074657 ) on Tuesday September 30, 2008 @01:19PM (#25206645) Homepage

      Too bad coreboot [coreboot.org] doesn't run on any of my motherboards. Imagine having a busybox terminal ready to go before the LCD monitor powers up.

    • While servers still seem to take hours to get past their BIOSes, modern laptops often have options for skipping the POST and generally taking shortcuts enumerating devices. The EeePC has a "BootBooster" option where it caches BIOSes results to solid state disk so the BIOS finishes in less than a second (rather than 4 or 5). It is so fast it can be a pain when you actually DO want to change a BIOS option!

  • POST (Score:5, Insightful)

    by riffraff ( 894 ) on Tuesday September 30, 2008 @12:15PM (#25205741) Homepage

    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.

  • password (Score:2, Funny)

    by neaorin ( 982388 )

    "The final trick: preloading desktop environment files while waiting for the user to type her password"

    My password is just the letter 'a'. Like in 'apple'. No luck for me then.

  • by FranTaylor ( 164577 ) on Tuesday September 30, 2008 @01:04PM (#25206409)

    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.

  • Amazon EC2 images (et alia) would find this useful.

    They will come online faster.

It is easier to write an incorrect program than understand a correct one.

Working...