The HP-UX Parallel rc Framework

2. For kill scripts, all other kill scripts within the run level whose names are alphabetically greater than
the given script are guaranteed to run after the given script.
These steps ensure that the Parallel rc Execution Infrastructure honors the implicit dependencies for
scripts that have not been enhanced to use the Parallel rc Framework.
Partially Specified Dependencies
HP recommends that you either specify all or no dependencies for any given script in the Parallel rc
Framework. The behavior of scripts that do not specify all its start or kill dependencies may result in
serious system failures.
Debugging Bottlenecks to Parallelism
The Parallel rc Execution Infrastructure can increase the throughput of scripts at run level transitions
subject to the following conditions:
1. There is sufficient parallelism available among the rc scripts.
If there are dependencies among scripts that cause them to be executed serially, then the benefits
of parallelism are reduced. Though this seems obvious, it is an important point to consider. As a
general rule of thumb, the lesser the number of dependencies specified, the greater the
parallelism.
2. There are sufficient resources in the system.
Even if there is sufficient parallelism, the gain in throughput may not be substantial or may even
reduce if there are insufficient resources. Resources may include CPUs, memory, Input Output
channels or devices, kernel resources and so on.
3. The rc scripts do not contend on shared resources.
Even when there is sufficient parallelism and resources, certain scripts that ought to run in parallel
may contend for the same resource. For example, scripts may create a large number of temporary
files in the /tmp directory. This may cause contention on the same I/O bus or secondary storage
device.
4. Dependencies are partially specified.
If a certain rc script depends on some other rc script in the same run level and one or more of
those dependencies are not specified, then the given rc script may stall or take longer than usual
to complete.
This paper outlines certain methods and recommends tools to debug bottlenecks to parallelism of rc
scripts. This is by no means an exhaustive list of troubleshooting information.
The first step is to measure the time taken to run a given script, first using the traditional rc script
sequencer, then by turning on the Parallel rc Execution Infrastructure. Time taken by a script can be
measured by instrumenting the script to emit the start and end times to stdout. Stdout is redirected to
/etc/rc.log. The output of kill scripts just before a reboot is logged in /etc/rc.log.old. The difference
between the end and start times gives the time taken by the script to execute.
The next step is to check whether the script takes longer to execute when run in parallel. If the script
takes substantially longer when run in parallel, then you must debug the bottlenecks further.
Check which other scripts run in parallel with the given script using the command line utility:
rcutil –p <script-name>