Specifying resource usage limits

About this task

Queues can enforce resource usage limits on running jobs. LSF supports most of the limits that the underlying operating system supports. In addition, LSF also supports a few limits that the underlying operating system does not support.

Procedure

Specify queue-level resource usage limits using parameters in lsb.queues.

Specify queue-level resource usage limits

About this task

Limits configured in lsb.queues apply to all jobs submitted to the queue. Job-level resource usage limits specified at job submission override the queue definitions.

Procedure

Specify only a maximum value for the resource.
For example, to specify a maximum run limit, use one value for the RUNLIMIT parameter in lsb.queues:
RUNLIMIT = 10

The maximum run limit for the queue is 10 minutes. Jobs cannot run for more than 10 minutes. Jobs in the RUN state for longer than 10 minutes are killed by LSF.

If only one run limit is specified, jobs that are submitted with bsub -W with a run limit that exceeds the maximum run limit is not allowed to run. Jobs submitted without bsub -W are allowed to run but are killed when they are in the RUN state for longer than the specified maximum run limit.

For example, in lsb.queues:
RUNLIMIT = 10

Default and maximum values

If you specify two limits, the first one is the default limit for jobs in the queue and the second one is the maximum (hard) limit. Both the default and the maximum limits must be positive integers. The default limit must be less than the maximum limit. The default limit is ignored if it is greater than the maximum limit.

Use the default limit to avoid having to specify resource usage limits in the bsub command.

For example, to specify a default and a maximum run limit, use two values for the RUNLIMIT parameter in lsb.queues:
RUNLIMIT = 10 15
  • The first number is the default run limit applied to all jobs in the queue that are submitted without a job-specific run limit (without bsub -W).
  • The second number is the maximum run limit applied to all jobs in the queue that are submitted with a job-specific run limit (with bsub -W). The default run limit must be less than the maximum run limit.
You can specify both default and maximum values for the following resource usage limits in lsb.queues:
  • CPULIMIT
  • DATALIMIT
  • MEMLIMIT
  • PROCESSLIMIT
  • RUNLIMIT
  • THREADLIMIT

Host specification with two limits

If default and maximum limits are specified for CPU time limits or run time limits, only one host specification is permitted. For example, the following CPU limits are correct (and have an identical effect):
CPULIMIT = 400/hostA 600
CPULIMIT = 400 600/hostA
The following CPU limit is not correct:
CPULIMIT = 400/hostA 600/hostB
The following run limits are correct (and have an identical effect):
RUNLIMIT = 10/hostA 15
RUNLIMIT = 10 15/hostA
The following run limit is not correct:
RUNLIMIT = 10/hostA 15/hostB