Scheduling Many Jobs for Execution

You should not dump a large number of background jobs on the machine at once. You will only slow down the machine, hurting yourself and everyone else using the system. At most times, you should limit yourself to two concurrent jobs. If they are extremely CPU-intensive, or if several other jobs are also running, limit yourself to only one. You can check the number and owner of running processes via the "top" command.

Since the CPU has finite resources, it divides them among the jobs submitted, spending time determining which process to perform next and transferring the appropriate data. So 10 jobs launched in sequence will complete more quickly than 10 jobs launched in parallel. A simple way to submit jobs in sequence is to create a shell script, simply a file of commands for the computer to execute. A sample shell script might be:

#!/bin/sh
# shell script to run jobs in sequence
NICE=/usr/bin/nice
COMMAND=$HOME/bin/command
$NICE -15 $COMMAND < input_1 > output_1
$NICE -15 $COMMAND < input_2 > output_2

Executing this script then launches the jobs in sequence, starting the next as soon as the previous has completed.

In the example above, the command is launched using the nice command. The nice command reduces the priority of your job on the system so that the interactive use of the system takes precedence. Note the difference between the shell script example and the command line: a minus "-" versus a plus "+". The shell script example accesses the UNIX command "nice" whereas the command line example utilizes the C-shell "nice" command. Please consult the csh and nice man pages for more information.