Can i force the kernel to boot it's initializations parallel ???
Hello,
I was wondering if i could mange to initialize drivers, services etc. (all these jobs what the kernel does during startup) in parallel instead of sequentially. I want to aggressively lower the boot time. I know some services depend on each other but to make an easy example: during probing the network devices, it shall take care of the audio too, instead of waiting 10 s until the network is ready. I heard of systemd and InitNG but I'm sure there has to be other methods. Isn't there an option for the kernel itself to boot this way ? Thanks and greets |
The kernel neither knows nor cares about them - that's why you have an init task to initialize all that.
There are some functions you can build into the kernel, but certainly not all. |
I heared, that the kernel is doing many jobs already in parallel, but i thought it was possible to still improve this on some specific needs of the application. So the biggest part seems to be the init system ? Are there alternatives to systemd and InitNG ?
|
The init daemons usually execute a series of scripts in, say, /etc/init.d/, and it always executes them in alphabetical order.
You'll observe that the files (or symlinks) here include a number in their names: "Snn" for start scripts and "Knn" for kill scripts. This is done on purpose, specifically to allow you to re-order the scripts. ("Kill" scripts are executed in reverse alphabetical order.) As far as I know, scripts are always executed one-by-one, for obvious reasons of simplicity. However, within a script, you might see things being executed in-parallel, say by using xargs with the -P maxprocs option. Which all makes sense ... "init" really doesn't know what each script actually does, so it executes whatever it finds, in an always predictable-sequence, and it allows each individual script to be the master of its own affairs. Scripts can potentially be written in any language or execute any program. I would frankly advise you to "go ahead and wait 10 seconds," or to explicitly specify your network configuration (once Linux has figured out what it is by booting-up once), so that in the future it doesn't have to "probe" and "discover." Mucking around too much with this aspect of the system is likely to cause unpredictability = trouble, with no real payoff for your troubles. |
thanks for the response, even I knew most of what you said, still i prefere these wide answers, because if I find something new it helps to have better search results.
To have a fast boot, many people recommend to put all the init-scripts into just one, and if you say that it's possible to make it parallel within a script it all makes sense. |
Quote:
So, maybe the answer is to look further into systemd, and see what it can do for you. |
All times are GMT -5. The time now is 09:43 PM. |