LWN.net Logo

Boot Fedora Linux Faster (Improved Source)

Here's an article that shows how one person modified a Fedora Core 4 system to make it boot faster. "As Linux has advanced it has increasingly become slower to boot. I have tested on my machine 4 Linux distributions: Linspire, Fedora 3 & 4, Suse 9.2 & 9.3, and Debian. And on average between all these distributions Linux needs around a minute to 1 and half minutes to go from boot loader to graphical login screen. So I decided to look into reducing the time it takes to boot my current setup, which is Fedora 4. In doing so I was able to reduce the boot time of my Fedora 4 installation to less than 25 seconds (just above 24 seconds on average). Below I have documented what I did, and what you can use to potentially reduce your boot up time for Linux."
(Log in to post comments)

Boot Fedora Linux Faster (Improved Source)

Posted Jul 26, 2005 18:38 UTC (Tue) by JoeBuck (subscriber, #2330) [Link]

The first sentence isn't quite right; things haven't been getting slower and slower. As shipped by Red Hat, FC4 boots a lot faster than earlier Fedoras, because there's more parallelism in the startup scripts. Gnome starts a lot faster as well, and that used to take about as long as booting up. Other recent distros also start up faster than before.

The unsung hero is the guy who did bootchart, Ziga Mahkovec, because before you can speed things up you need to know what's going on.

Boot Fedora Linux Faster (Improved Source)

Posted Jul 26, 2005 18:47 UTC (Tue) by jwb (subscriber, #15467) [Link]

Parallelism in startup is frequently a cause of slowness, not a solution. And the parallel readahead that some distributions have implemented simply causes the disk to thrash more and more slowly.

Ubuntu's parallel startup is the worst. It starts gdm very early in runlevel 3, but there are so many other scripts running that it's almost pointless to have GNOME "starting" when it will be a good minute or two before the system is really usable. And then, to add further insult, some init.d script steals the serial port, disables the mouse, and I have to restart X anyway.

NetBSD has a really nice init system with explicit dependencies that Linux should surely copy.

Boot Fedora Linux Faster (Improved Source)

Posted Jul 26, 2005 18:56 UTC (Tue) by JoeBuck (subscriber, #2330) [Link]

It seems Ubuntu may be using Windows XP's approach, where the system appears to boot quickly, but the initialization continues to run for several minutes after the user has a GUI.

Parallelism speeds things up if disk I/O is parallel with CPU-intensive tasks. It only slows things down if unnecessary work is done.

Boot Fedora Linux Faster (Improved Source)

Posted Jul 26, 2005 19:38 UTC (Tue) by tajyrink (subscriber, #2750) [Link]

Not really. I also think Ubuntu's (5.04) approach is not yet thoroughly efficient, though better than in 4.10 where there were no attempts to optimize booting, but the disk access does stop as soon as the GDM login screen appears, at least for me. I think these issues are going to be further investigated in 5.10, where also Gnome start-up will hopefully be optimized (both via Gnome 2.12 and Ubuntu).

Also, disk access stops (again) as soon as Gnome desktop has been loaded.

Boot Fedora Linux Faster (Improved Source)

Posted Aug 2, 2005 15:55 UTC (Tue) by aglet (guest, #1334) [Link]

Mac OS X's SystemStarter looks nice to me -- see http://www.opendarwin.org/en/articles/system_starter_howto/ for example

Boot Fedora Linux Faster (Improved Source)

Posted Jul 26, 2005 19:51 UTC (Tue) by dlang (subscriber, #313) [Link]

on my systems waiting for hotplug and udev cause more delays during boot then anything else (especially when combined with monolithic kernels that only include drivers for hardware that I have). avoiding having drivers and hotplug check for stuff is a HUGE win.

about the only place I actually allow hotplug/udev to run is on laptops, I eliminate them on servers.

Boot Fedora Linux Faster (Improved Source)

Posted Jul 26, 2005 20:31 UTC (Tue) by wicky (guest, #28101) [Link]

I was surprised about the time Solaris 10 takes on my sluggish SPARC Ultra
II (440 Mhz) to boot:Only 1 minute. Faster than every Linux system
(Suse 9.3, FC3, FC4, Sarge) on the 2-2,5 GHz I have here. If you take into
account the hardware it's even more surprising.

Boot Fedora Linux Faster (Improved Source)

Posted Jul 26, 2005 20:44 UTC (Tue) by einstein (subscriber, #2052) [Link]

No surprise there.

Just take a look at what exactly solaris does to "boot", and compare that to what a linux distro does to "boot".

apples and oranges.

Boot Fedora Linux Faster (Improved Source)

Posted Jul 29, 2005 1:09 UTC (Fri) by paulj (subscriber, #341) [Link]

Or Solaris 10's 'SMF' could be a factor - it's dependency aware. About 30s to boot S10 x86 to point where it kicks off GDM here - bit longer till you get GDM login cause Xorg is slow to init.

Solaris vs Linux boot time

Posted Jul 29, 2005 23:58 UTC (Fri) by giraffedata (subscriber, #1954) [Link]

The speeds of the CPUs are probably not relevant. In the referenced article, the charts show that there isn't a whole lot of processing involved in booting. It's a lot of disk access and other I/O access.

Boot Fedora Linux Faster (Improved Source)

Posted Jul 27, 2005 1:01 UTC (Wed) by sidboyce (guest, #10891) [Link]

When I have to reboot, very infrequently, it's a one-off operation, so the boot time doesn't matter, even when I used the work laptop going to other offices and customer sites, it didn't matter. What matters is how fast it runs when it's up, boot time being only an insignificant percentage of total compute time.

Boot Fedora Linux Faster (Improved Source)

Posted Jul 27, 2005 2:19 UTC (Wed) by danielthaler (subscriber, #24764) [Link]

I on the other hand am very interested in boot times: standby doesn't work on my laptop, so I shut it down whenever I move it. Which inevitably means waiting for it to boot again when I arrive.

Boot Fedora Linux Faster (Improved Source)

Posted Jul 27, 2005 3:55 UTC (Wed) by xtifr (subscriber, #143) [Link]

What is this "booting" you speak of? :)

Saving one min per boot ought to save me...oh...about five minutes a year! (I do like to update my kernels semi-regularly.) Still, I suppose it's useful info for those who find this sort of info useful...

Actually, it's interesting research, even if it doesn't have much practical application for many of us. A better understanding of how the pieces fit together is never a bad thing.

Boot Fedora Linux Faster (Improved Source)

Posted Jul 27, 2005 6:51 UTC (Wed) by wildpossum (guest, #17744) [Link]

Get a notebook computer and you will change your tune. :-)

bootchart is a really nifty package I agree.

Boot Fedora Linux Faster (Improved Source)

Posted Jul 28, 2005 1:54 UTC (Thu) by xtifr (subscriber, #143) [Link]

I've seen several people make the same comment, but I really don't understand. I had an old Thinkpad running Linux, and I can't say I booted it all that much more often than my desktop system. Once or twice, I let the battery get so low that I didn't think I'd make it to a power source, even with the system suspended, so I shut it down. But that was pretty rare. At most, I'd say averaged about a dozen boots a year on the notebook.

Boot Fedora Linux Faster (Improved Source)

Posted Aug 8, 2005 0:43 UTC (Mon) by quintesse (subscriber, #14569) [Link]

Nice for Thinkpads maybe but I havenīt been able to get my Dell laptop to suspend reliably so yes I would be very interested in a faster boot sequence. Of course I would even be more interested in a better working suspend for all kinds of computers ;-)

Boot Fedora Linux Faster (Improved Source)

Posted Jul 27, 2005 12:08 UTC (Wed) by NAR (subscriber, #1313) [Link]

Still, I suppose it's useful info for those who find this sort of info useful...

Well, I boot the computer into Linux once in the morning to check mails, news, etc. Then shut it down and go to work. In the evening I boot it once more, check mails, news, etc. Then boot into the other operating system to play games. Then after I finished, I might boot Linux once more to check mails, news, etc. - so a slow booting time definitely hurts. In fact, it hurts enough that I use software suspend instead of shutdown/boot, it's just too bad that the 2.6.12 kernel boke the suspending of the bttv driver...

Bye,NAR

Boot Fedora Linux Faster (Improved Source)

Posted Jul 27, 2005 23:16 UTC (Wed) by einstein (subscriber, #2052) [Link]

Why boot into another OS just to play a game? I don't like my uptimes being ruined, and besides, all the games I play regularly (q3a, doom3, ut2004, etc) all run just great natively on linux.

Boot Fedora Linux Faster (Improved Source)

Posted Jul 29, 2005 4:54 UTC (Fri) by apollock (subscriber, #14629) [Link]

Oh please. Winning an uptime pissing contest just means you aren't patching your kernel for security vulnerabilities.

Boot Fedora Linux Faster (Improved Source)

Posted Jul 29, 2005 6:15 UTC (Fri) by einstein (subscriber, #2052) [Link]

Not really. It just means I enjoy stability.

I do apply vendor supplied kernel updates, so the "pissing contest" is a figment of your imagination I'm afraid. A theoretical kernel vulnerability is typically addressed every few months, and if it's applicable to my environment I'll go ahead and apply the upgrade during a maintenace window.

OTOH, anyone who feels that constant reboots are somehow neccessary is most likely from a microsoft background.

Boot Fedora Linux Faster (Improved Source)

Posted Jul 27, 2005 3:56 UTC (Wed) by jimmybgood (guest, #26142) [Link]

Here's an interesting thread covering the earlylogin option:

http://www.redhat.com/archives/fedora-test-list/2005-Apri...

By the time I get my username and password entered, it's ready to log me in. Earlylogin definitely saves several seconds. OTOH, it still takes twice as long as my trim Debian system with no hardware detection and no unneeded drivers being loaded.

init-ng, and Debian's initscript-ng project

Posted Jul 27, 2005 4:46 UTC (Wed) by hmh (subscriber, #3838) [Link]

Well, for what is it worth, there is a workgroup trying to do whatever is necessary to ship a dependency-based initscript subsystem integrated into Debian Etch or Etch+1. Those that would like to help design and write initscript-ng for Debian are welcome to drop by http://alioth.debian.org/projects/initscripts-ng/

There is also init-ng (http://initng.thinktux.net/index.php/Main_Page) which anyone interested into the whole next-generation initscript deal should get acquinted with. It is a really cool piece of software.

init-ng, and Debian's initscript-ng project

Posted Jul 27, 2005 22:49 UTC (Wed) by jonabbey (subscriber, #2736) [Link]

Anyone know if any Linux distros are taking up Apple's open sourcing of launchd? It, like Solaris 10's SMF, supports declarative dependency statements and can do dynamic optimization of launch ordering in a way that puts to shame the old SysV init scripts system.

init-ng, and Debian's initscript-ng project

Posted Jul 28, 2005 23:55 UTC (Thu) by khim (subscriber, #9252) [Link]

Gentoo init scripts have dependency information and cat start few things in parallel (but it's not default).

There are some projects to make replace init with something better - nothing production-ready yet.

init-ng, and Debian's initscript-ng project

Posted Jul 28, 2005 10:14 UTC (Thu) by peterhoeg (subscriber, #4944) [Link]

I made a quick hack (one liner!!) to enable Debian to boot certain things in parallel and it really helped here.

Details are here:
http://www.hoeg.org/blog/2005/07/27/fast-booting-debian/

init-ng, and Debian's initscript-ng project

Posted Jul 28, 2005 16:47 UTC (Thu) by shane (subscriber, #3335) [Link]

I've recently started helping hack on initng, and I think it has a lot of
promise. I think it needs a *lot* of work before it is ready for
prime-time though.

Most of my recent work has been in the area of adding tests and making
minor fixes to the code. Not fun, but necessary IMHO if a stable,
maintainable piece of software is the goal.

Having said that, people really do use it to boot their systems. :)

Boot Fedora Linux Faster (Improved Source)

Posted Jul 30, 2005 0:16 UTC (Sat) by giraffedata (subscriber, #1954) [Link]

The article suggests that binding a kernel module into the base kernel saves significant time over loading it separately, but the experiment doesn't actually isolate that variable. I kind of doubt it. There's no difference between the initialization of a driver in both cases and probably no visible difference in the amount of time it takes to read it from disk.

The modprobe time is probably mostly accessing devices. It's long enough, with hardly any CPU or disk usage, that I suspect a discovery process that involves timeouts.

One thing you can say about putting stuff into the base kernel is that you lose all ability to do an analysis like this, and much of the ability to tune things by e.g. changing the list of drivers you load at boot time.

Copyright © 2005, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds