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.
"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.
Develop a better initialization sequence. Relying on a scripting language, such as bash, to initialize each system component slows down bootup time. Instead design a standard such that daemons can be stop/started/restarted with a standardized set of command line options.
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.
Why is it taking long to boot up? That's not my experience. Loading a lot of services?
=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Friends don't let friends enable ecmascript.
someone has a use for this
You bet.
How long are you willing to wait for your stereo receiver to boot up, your TV, or your TiVo?
This is a really important issue for embedded devices like consumer electronics built on Linux.
"Provided by the management for your protection."
9 second boot time from power-up to X-windows
> 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.
I see there are already a ton of linux fanboys and girls posting about the incredible uptime of their linux boxes, and claiming that a) boot time doesn't matter because linux doesn't go down or b) linux boots very fast.
They are wrong. Boot time matters.
It matters for perception. Boot time is one of the periods where a user spends the most time looking at a screen not being able to do anything (even if that happens rarely). A faster boot time leads to a sense that the whole system is faster, because it is a first impression, and a significant impression. If linux bliped on from a cold start in 5 seconds, I'd be studies would show it appeared faster.
Boot time matters because not everyone (in fact, very few people) leave their systems on all the time. Slashdot fan boys living at home may not agree, but they are wrong.
Think about business systems. At my place of work, everyone turns their computer off at the end of the day, and on at the beginning of the next. My mother doesn't leave her computer running 24/7, she turns it OFF when she is done using it. My roomates do the same thing. Even I do it sometimes.
Boot time matters because power management is still evolving under linux. As power management requires the cooperation of a number of pieces of a system, power management is still a work in progress. Once power management with every peripheral is flawless, then we can start to dial back boot time worries (only a little).
Boot time matters server side too. I know folks are going to complain that I focus on the user too much. But boot time matters server side as well. We have UPS units on our servers. They have however a limited lifetime. So when the power drops for a few minutes (which it does here somewhat often) automatic shutdown process starts.
When the power comes back on, people power up their computers. These being Windows XP machines they actually start pretty quickly (or never went off if on a UPS). If folks were in the middle of something, they expect that with the power their logon and other services will be back in action. Then all the individual computers start timing out / locking up, generating help calls.
On the server side, if there was an emergency security patch, or we were coming up from a power outage, the faster the boot time the better, if I can beat out even 20% of the client connect attempts.
Boot time matters, a big bravo to the folks working to improve this.
Since you have to work out the dependices yourself, why not imbed the dependices in the startup scripts themselves? So for example, the nfs startup script would block until the network script got started. The status can be checked by parsing /etc/rc.d/init.d/network status. You may want a timeout on the blocking. If you do this you could just start all the scripts at once.
I think this will be useful only for desktops actually. Embedded devices do not usually run as many services as desktops. And the embedded Linux implementations seem to boot plenty fast as it is.
For example, my Linksys WAP boots up in about 10 seconds.
For a better embedded example, look at a Compaq iPAQ H3650 circa 3 years ago running Familiar Linux with the Opie desktop. It boots up in about 8 seconds. Then it's "instant" on/off unless you hard reset the device. It's also running more services than the default install.
I've got a dual Athlon 2000+. The boot time improvement is next to inexistent. Overall it boots slower, due to the initial delay (about half a minute) to initialize ECC RAM, and the second or two Linux needs to initialize SMP.
Now, it's definitely a really big improvement over a 1 CPU system.
It's really smooth, and I can:
Burn CDs at 24x and play Quake 3
Compile programs using both CPUs and play videos at the same time.
Kill high priority programs (like sound daemons) that went mad for some reason and got into an infinite loop. This happened me with KDE a few months ago. With 1 CPU my computer froze for minutes until it could react to my request to kill the daemon. With SMP, no problem, I still have an idle CPU.
It's really nice for Gentoo. KDE compiles in several hours, and my computer isn't slowed down noticeably by the compilation. The basic Gentoo installation is done in a day, I can get all the necessary programs compiled during the second day.
The hardware is really stable too. Never locks up, never crashes. ECC RAM gives great peace of mind, too.
And if you stick around long enough at DeveloperWorks, you'll make a grid out of those PCs and offer the district more compute power than they ever realized they had.
Intelligent Life on Earth
You beat me to it. OS X also implements dynamic disk mounts even for root. Disks are mounted and assigned to a device on a first-come first-served basis.
Some people like to conserve energy when possible. Just do it! It's good for the environment!
Ok, I agree that boot time is important in many specific cases. However, you say
/etc/rc3.d and find a whole bunch of services whose names you don't know, just remember that they might actually extend functionality beyond what you could get with another OS. If you ever truly do make your installation sleek and tiny, then give it another test and see what you find.
I see... fanbody and girls... claiming that... b) linux boots very fast. They are wrong.
This seems to be the prevailing wisdom here, so this is for everybody. I just have to disagree. A standard GNU/Linux distro (like Mandrake, for instance) will startup a buttload of services (depending on what you select at install time), and do far more than a standard Windows install (for instance). It will in fact run at startup every service that you've told it to install (again depending on if you tell it to, but I believe it will do this by default). Often this includes one or more databases (postgres, mysql), a web server (apache), perhaps a few file sharing services (samba, nfs, ftp), a few remote command services (ssh, telnet), and its usual collage of helpful newbie services (autodetect hardware, boot numlock, etc). Now, with all of this crap running on my antique P Pro 200-64mb, I boot in less than a minute from lilo to login prompt (and X is about 5 seconds more). I think XP home would barely beat that time on a system that old, and it can't serve things. And yes, faster systems scale nicely; my Debian system is extremely fast lilo->kdm; as good as my XP pro in fact, and it still has all the server trimmings.
Now, on the other hand (for a fair comparison), if you've ever experienced a windows 2000 server machine with active directory, you know real pain. From boot.ini to load of video drivers is fast, but after that, restoring network connections can take as long as five minutes even on a fast system.
So in conclusion, a default install of any random distro may or may not be slower starting up than another OS (read Windows), but just make sure you're making a fair comparison. If look through your