7.4.1 Changing the Behavior of Batch Jobs

The load average of a system, as displayed by the uptime and w commands, represents the average number of processes that are queued to run on the CPUs or CPU cores over a given time period. Typically, a system might not considered overloaded until the load average exceeds 0.8 times the number of CPUs or CPU cores. On such systems, you would usually want atd to be able to run batch jobs when the load average drops below the number of CPUs or CPU cores, rather than the default limit of 0.8. For example, on a system with 4 CPU cores, you could set the load-average limit above which atd will not run batch jobs to 3.2.

If you know that a batch job typically takes more than a minute to run, you can also change the minimum interval that atd waits between starting batch jobs. The default minimum interval is 60 seconds.

To change the load-average limit and interval time for batch jobs:

  1. Edit /etc/init.d/atd, and add a line that defines the new load-average limit, minimum interval, or both in the OPTS variable for the atd daemon, for example:

    OPTS="-b 120 -l 3.2"

    This example sets the minimum interval to 120 seconds and the load-average limit to 3.2.

  2. Restart the atd service:

    # service atd restart
    Stopping atd:                                              [  OK  ]
    Starting atd:                                              [  OK  ]
  3. Verify that the atd daemon is running with the new minimum interval and load-average limit:

    # ps -fC atd
    UID        PID  PPID  C STIME TTY          TIME CMD
    root      8359     1  0 12:06 ?        00:00:00 /usr/sbin/atd -b 120 -l 3.2

For more information, see the atd(3) manual page.