Sponsored by wix.com
33 Comments
- hgcphoenix, on 10/12/2007, -0/+12I noticed the article is dated Sept 2003.
" Perhaps an obvious way to speed up the starting of services is to run all the services in parallel, so that they all start at the same time. Unfortunately, while this sounds highly appealing, it does not work. ....."
Doesn't linux have support for starting non-dependent services in parallel now ?
It says so here
http://www.linux.com/article.pl?sid=06/04/13/173227 - thejof, on 10/12/2007, -0/+7It can be a pretty big jump.
While this is an ok article, a project by Jimmy Wennlund called initng already handles this way better than the busted-ass sysvinit system (sorry AT&T...).
It's at http://www.initng.org - shotgunefx, on 10/12/2007, -1/+7The whole point is that linux users could always do this if they wanted to. Try retrofitting that into a version of windows that doesnt' support it.
And it's a good article, but yes, it's been out for awhile. - jeandp, on 10/12/2007, -3/+9I don't think a regular Linux user like myself worries too much about boot speed, since I don't have to reboot every day. I recently switched from windows to Ubuntu, and the first thing I had to teach myself was that if its not working, reboot will seldom solve the problem on Linux, unlike windows.
- Ademan, on 10/12/2007, -2/+6There's also upstart which ubuntu edgy will be adopting.
- EGOvoruhk, on 10/12/2007, -0/+4You are so insightful!
Whoops! Did I digg you down!?... - mikm, on 10/12/2007, -0/+4You're forgetting that your system almost ALWAYS has more than one active process at any given time.
- rasputnik, on 10/12/2007, -0/+3This is what 'upstart' does. It's the default boot method in Ubuntu Edgy (which is officially out next month) and boot times are much faster. See:
http://www.netsplit.com/blog/work/canonical/upstart2.html
Solaris 10s SMF does a similar thing (parallelized service starting), and it boots incredibly quickly. - hgcphoenix, on 10/12/2007, -0/+3Here's a recent article about parallel booting of services.
http://www.linux.com/article.pl?sid=06/04/13/173227 - rasputnik, on 10/12/2007, -0/+3Most service startup isn't CPU bound.
- neko, on 10/12/2007, -2/+5I don't need to boot fast, I just don't reboot.
- mason.parker, on 10/12/2007, -0/+2Article's a bit old but these DeveloperWorks articles are always interesting. The AJAX ones especially.
- RevEng, on 10/12/2007, -0/+2Common question, generally misunderstood answer.
You've made the assumption that all processes are CPU-bound or all processes are I/O bound. Of course, every process does a combination of these things. If two processes are running simulatenously, it's likely that one will be doing computations while the other is doing I/O: this is the whole premise of multitasking.
Bootup is a special case, because it generally requires a lot of I/O (loading programs from disk) and not a lot of computation. However, running in parallel is still useful because the hard disk is able to burst a lot of data, typically faster than a loading program can request it. The hard disk driver is able to queue up several file reads before doing a burst, so even though a single process is loading a file as fast as it can, this is not the limit of the hard disk bandwidth. It's similar to downloading a file over the Internet--latency limits the per-connection bandwidth, but several connections can run in parallel, using up the slack bandwidth.
Despite this special case consisting of mainly I/O, the slowest startup services are things like dhclient or pump, which need to wait a relatively long time for a response from a server, but are otherwise not occupying the computer in any way. Since many services do not require a network, and dhclient doesn't require much of anything, it could easily be loaded in parallel to other services. In fact, this is one of the most noticable differences between Windows 9x and 2000/XP. Unplug your network cable on your Windows 9x machine and see how long it takes start up; it's not pretty. Do the same under XP and you shouldn't notice any difference. The reason? XP does DHCP in the background (which is also why it handles un(plugging) of network cables, whereas 9x requires a restart or manually renewing). Likewise, changing a few settings in your boot scripts can typically have the same effect under Linux. Why major distros don't already do this is a really good question to ask them. - zlatko, on 10/12/2007, -0/+2More advanced papers on the topic:
http://linux.inet.hr/ols2006_startup_time_in_the_21st_century_filesystem_hacks_and_assorted_tweaks.html
http://linux.inet.hr/ols2006_improving_linux_startup_time_using_software_resume_and_other_techniques.html
http://linux.inet.hr/ols2006_linux_bootup_time_reduction_for_digital_still_camera.html
http://linux.inet.hr/ols2004_methods_to_improve_bootup_time_in_linux.html - RevEng, on 10/12/2007, -0/+2I'm really surprised that nobody has mentioned BSD init scripts. It's rather unfortunate that SysV init was more popular (VHS vs. Beta) because BSD made this easy.
When I used to help with LinuxFromScratch, one developer--Matthias Benkman--modified simpleinit to use named run levels, dependencies, and parallel loading of services. That was back in...'97? Geez, it's been awhile.
Anyway, to those saying, "Windows XP already has this!", well actually, Linux and BSD have had it for several years, but is just so happened that the competing program which didn't have it became the more popular one. Something about not having to load 60-some services which made it unnecessary. :P
Unfortunately, many Linux distributions are now loading every service in the book, so we've only become our own worst enemy.
And just to clarify, "Linux" is the kernel. sysvinit is the program that handles the init scripts on almost every GNU/Linux distribution. Don't bother blaming Linus for this one; I'd say the entire community of Linux users (myself being one of them) who generally demand sysvinit is to blame. - i440, on 10/12/2007, -1/+2Is the difference really all that significant?
- AlphaMack, on 09/26/2008, -1/+2Seems like it's just easier to grab sysv-rc-conf and run it:
sudo sysv-rc-conf -s 2S
Realistically you're not going to be using all of the run-level services, especially if your box is fairly old (seriously, do you need Bluetooth services?). The downside of doing this of course is that the whole thing is Greek to noobs and should not be attempted without a deep understanding of what the services are and what they're for. Then again, how often do you reboot Linux?
Of course, you could also utilize hdparm to speed things up... - tonywestonuk, on 10/12/2007, -2/+3Can someone explain to me, why on single processor systems, this can make things faster?.... If you take 2 services, that take 2 seconds each to start up on their own (4 secs in total), running them in parallel, is going to double the time each takes to start, as both will be fighting over processor resources....therefore, its still gonna take at least 4 seconds to startup, and probably more because of task switching overhead.
- cslarson, on 10/12/2007, -0/+1i reboot my laptop.
- halfcockedjack, on 10/12/2007, -0/+1Does this stuff work with VMware?
- GMorgan, on 10/12/2007, -0/+1Depends on the system. Gentoo has a vey quick boot time mainly because they don't add endless amounts of sleep calls to their init scripts and trust the user to look after their machine. More ready built distros tend to err on the side of caution and add sleep commands everywhere. Obviously theres a lot of other stuff as well but it tends to be the case that user friendly == slow.
So for Ubuntu you could gain loads but on more customisable distros there tends to be less to do and their closer to optimal (or unstable some claim) to begin. - greyfade, on 10/12/2007, -0/+1for Gentoo users, add the following to /etc/conf.d/rc:
RC_PARALLEL_STARTUP="yes"
w00t. - dandaman0061, on 10/12/2007, -1/+2Yea... but to someone like me who is learning linux for the sake of building a carputer (and the bunch of other people doing it www.mp3car.com), every fraction of a second helps.
- xxNIRVANAxx, on 10/12/2007, -1/+1poorly-coded blog spam
- eurgain, on 10/12/2007, -0/+0You should answer your own question!
Install a linux guest, get it working, then take a snapshot.
Play around with your guest OS (timing reboots)
until your heart's content ( alor you have broken the gest OS and it won't boot anymore).
Then, either revert to the snapshot or start all over again.
This is the great thing about VMWare. It allows you to mess around with OSes until you loose the will to live, but you still have a working computer.
A - fogbog293, on 02/10/2009, -1/+1initng? I don't know if I'd trust my boot system to software developed by a man who sells ice cream for a living....
- eurgain, on 10/12/2007, -0/+0The second para of above should read:
"Play around with your guest OS changing whatever you want and timing reboots if need be
until your heart's content (or you have broken the guest OS and it won't boot anymore)."
Sorry, I am new to Digg, and I have not yet figured out how to edit things!
A - eurgain, on 10/12/2007, -0/+0Well, as a big Gentoo fan and long-term user... that is what it says in the file, but have you tried setting it to "yes"?
In my multiple experiences, networking is broken. Major things like NFS client and SSH server fail because they have not waited until eth0 is up. I think that the system waits for *any* net interface before trying to start these services. Unfortunately, "any" seems to include lo, and if eth0 is configured using DHCP, dependent network services may have aborted (having got nothing useful from lo ;-) long before the DHCP configuration has completed.
If you have a solution to this, I'd be interested.
But rebooting is passé. Almost all machines do software suspend to disc an indefinite number of times, and my laptops can go through many tens of suspend-to-ram cycles between re-boots.
IMO, ACPI S3 suspend/resume is the real test of how quickly any operating system provides service to a user from a dormant state. (FWIW, SUSE 10.1 does resume from ACPI S3 suspend on my Dell I8600 in about 4 seconds; WinXP takes about 15.)
A - izelpii, on 10/12/2007, -0/+0In FC4 you can do it.
The change of boot speed is great. I remember I cut from 45s to something like 20s when I first did it.
And thinking that generally boot speed is considered a factor when evaluating some characteristics of the OS, I think is important to consider.
I remember I had a complete guide from the guy that first did this, but now I don't have the link. This is a different one that talks about it.
http://www.gagme.com/greg/linux/fc4-tips.php - ayeroxor, on 10/12/2007, -2/+1Let me guess: Disable precache?
- JayByrd, on 10/12/2007, -1/+0Maybe I'm missing something here. But my Linux desktop here @work gets booted like 2 or 3 times a year. My Linux boxes at home get booted 4 or 5 times a year. Saving a few minutes of boot saves me maybe 10 minutes annually.
Not a big issue here. - DontSayFanboy, on 10/12/2007, -2/+0Right, so take two I/O bound apps and running them simultaneously is better? The typical user has their OS installed on one hard disk. At least with a CPU bound app running two at the same time could take advantage of dual cores.
- Lamity, on 10/12/2007, -11/+1[Flamebait] Glad to see Diggers are posting up to the minute articles ... 17 Sep 2003 lol. The funny thing is that XP and 2K3 have had service level parallisation it it for a loooong time.
What is Digg?