- 31 Dec 2020
- 2 Minutes to read
- Print
- DarkLight
Allowing a Job to Specify Thread Pool
- Updated on 31 Dec 2020
- 2 Minutes to read
- Print
- DarkLight
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 actually begin running until 5:20 AM because it could not start until Job A had completed. The Job Scheduler does this to protect 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
- Navigate to the System > Jobs and Events > Scheduled Jobs Folder in the Portal. Then, click NEW AD SYNC JOB from the top Action bar.
- Create an Ad Sync Job with the Scheduled Job Name A, then select Specified Job Schedule from the Calendardropdown.
- Designate the Date, then click SAVE.
- Repeat the NEW AD SYNC JOB process four more times, providing the names B, C, D, and E.
- Jobs A ad B are going to be in the Default Queue Pool.
Right-click Job C and select Edit Scheduled Job.
Scroll down to ADVANCED > Values and in enter My Queue Y into Override Job Queue Name, then click OK to save.
Repeat this process for Job D, being sure to specify Override Job Queue Name as My Queue Y; click OK to save.
Edit Job E this time 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 actually 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 completed. Because Job C is in the same pool as Job D, Job D will not begin until Job C has 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.