Allowing a Job to Specify Thread Pool
  • 03 Jul 2024
  • 2 Minutes to read
  • Dark
    Light

Allowing a Job to Specify Thread Pool

  • Dark
    Light

Article summary

Overview

By default, the Job Scheduler runs all jobs in the same Queue; this means that only one job will run at a time.
For example, if Job A is scheduled to run at 5:00 PM and Job B is scheduled to run at 5:10 PM, but Job A takes 20 minutes to complete, Job B will not begin running until 5:20 AM because it could not start until Job A had completed. The Job Scheduler protects the server from being inundated by too many jobs running at once.

However, in some cases, a user may want to override this default behavior and allow a job to run in a separate Job Queue, thus allowing it to run in parallel with other jobs.


Example

There are many different jobs, but all have the same option for configuring Queue Name. This setting is the same regardless of job type, and this example will show how to change the Queue Name option on the Job Settings Page. Create five jobs to fully illustrate how to use Job Queues and configure their Queue names.
  1. Navigate to the System > Jobs and Events > Scheduled Jobs Folder in the Portal. Then, click NEW AD SYNC JOB from the top Action bar.
  2. Create an Ad Sync Job with the Scheduled Job Name A, then select Specified Job Schedule from the Calendar drop-down.
  3. Designate the Date, then click SAVE.
  4. Repeat the NEW AD SYNC JOB process four more times, providing the names B, C, D, and E.
  5. Right-click Job C and select Edit Scheduled Job.
  6. Scroll down to ADVANCED > Values and enter My Queue Y into Override Job Queue Name, then click OK to save. 
  7. Repeat this process for Job D, being sure to specify Override Job Queue Name as My Queue Y; click OK to save.
  8. Edit Job E, specifying the Override Job Queue Name value as My Queue Z, then click OK to save. 
    If all these jobs are scheduled to start at 5 PM, three of the five jobs (Job A, Job C, and Job E ) will start at that time because the jobs are in three separate queues (Default pool, My Queue Y, and My Queue Z).

    Because Job A is in the same pool as Job B, Job B will not begin until Job A has been completed. Because Job C is in the same pool as Job D, Job D will not begin until Job C has been completed.

    However, Job C will begin at the scheduled time because it is in a different pool than Job A and Job B. Because Job E is in its own pool, it will start at the scheduled time regardless of which other jobs have also started at that time.


Was this article helpful?