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 minimum interval time for batch jobs:

  1. Edit the atd configuration file, /etc/sysconfig/atd, uncomment the line that defines the OPTS variable, and edit the line to specify the new load-average limit and minimum interval time, for example:

    OPTS="-b 100 -l 3"

    This example sets the minimum interval to 100 seconds and the load-average limit to 3.

  2. Restart the atd service:

    # systemctl restart atd
  3. Verify that the atd daemon is running with the new minimum interval and load-average limit:

    # systemctl status atd
    atd.service - Job spooling tools
       Loaded: loaded (/usr/lib/systemd/system/atd.service; enabled)
       Active: active (running) since Mon 2014-04-28 15:37:04 BST; 2min 53s ago
     Main PID: 6731 (atd)
       CGroup: /system.slice/atd.service
               └─6731 /usr/sbin/atd -f -b 100 -l 3
    Apr 28 15:37:04 localhost.localdomain systemd[1]: Started Job spooling tools.

For more information, see the systemctl(1) and atd(8) manual pages.