Preventing Queue Hogging

By default, the Job Scheduler allows queue hogging. This means that the Job Scheduler allows a user who has several consecutive jobs on the queue to have all of those jobs processed before the jobs of any other user. That situation can result in long waits for other users if the first user has several long-running jobs scheduled to be processed one after the other. You can change the default behavior for the Job Scheduler through the QUEUEHOGGING parameter in the lajs.file.

If you change the QUEUEHOGGING parameter setting to NOT ALLOWED, then after the first job by the original user is processed the Job Scheduler will look for a job from another user and process that before returning to process the next job from the first user. For example, assume that the queue is as follows:

User1   Job1   Running
User1   Job2   Waiting
User1   Job3   Waiting
User1   Job4   Waiting
User2   Job1   Waiting
User2   Job2   Waiting

With queue hogging allowed, these jobs would be processed in the following order:

User1/Job1, User1/Job2, User1/Job3, User1/Job4, User2/Job1, User2/Job2

With queue hogging not allowed, these jobs would be processed in the following order:

User1/Job1, User2/Job1, User1/Job2, User2/Job2, User1/Job3, User1/Job4

Note that once User2 has run a job, User1 runs his next job, then User2 runs another job. Since there were no other user jobs waiting, User1 then was allowed to run his last two jobs consecutively. This functioning depends on tracking the user of the last job submitted on each queue and then checking this before the next job is allowed to run. If there are jobs for others in the queue, a different user’s job is allowed to run and this user name is saved as the last user for that queue. When the queue is checked for the next job to run, the first user now doesn’t match the saved last user and so that user's next job is allowed to run and that user becomes the saved last user again. This in turn allows a different user's job to run next.

Note: On queues that allow multiple jobs to run at the same time, you may see multiple jobs from one user running with some or none of another user's jobs, depending on the number of jobs allowed and the run time of the jobs. This is because the last user is saved when a job is submitted. However, the choice of which job to run next will be decided in the same was a with queues that do not allow multiple jobs to run at the same time. Note also that queue hogging only applies to the normal job submission and run process. It is not used for recovery or when lajs is started or restarted with jobs in a running status.

To turn off queue hogging

  1. Using a text editor, open the /EnvironmentDirectory/law/system/lajs.cfg file in the IFS.
  2. Change the QUEUEHOGGING parameter value to NOT ALLOWED
  3. Save and close the file.
  4. Stop and restart the server. At the Qshell command line, type:

    stopjobq

    startlajs