Skip to main content

Priority-based Batch Scheduling

 Priority-based batch scheduling enables users to assign a priority level to each batch job. The priority level determines the order in which jobs are executed, with higher priority jobs being processed before lower priority jobs. This enables users to control the sequence of job execution and ensures that critical tasks are completed in a timely manner.

It decouples batch groups from the batch server and allows you to define priorities for batch groups. As shown below, we can set the Scheduling Priority in Batch Group form. If you can not see this field in the form, it can be added by inserting column via personalization of form.

The available values for the scheduling priority are LowNormalHighCritical, and Reserved capacity.

Normal is the default value and is applied to all existing batch groups when the feature is turned on. Reserved capacity represents the highest priority.

Priority-based scheduling feature was available from version 10.0.25. This feature was enabled by default for all new instances with version 10.0.28. This feature is enabled by default for all existing instances with version 10.0.29 or above.

You can enable this feature from Feature Management Workspace as shown below.

We have setup the Scheduling priority on Batch Groups. Therefore, Scheduling priority will be updated in all batch jobs associated with these batch groups when we enable the feature. However, if we want to change the Priority of Batch Job only instead of Batch Group, its also possible by two fields in Batch Job form (Job Scheduling Priority and Scheduling Priority is overridden).

Effective Scheduling Priority field in below screenshot displays the scheduling priority set on a batch job. This field is non editable and if you need to change Priority at Batch job level then add those two fields by right clicking on form grid and click on insert columns.

To update Scheduling Priority in a batch job, we must enable Scheduling Priority is overridden checkbox and update value in Scheduling Priority field.

Set the batch reserved capacity level

Reserved category priority is different from other priorities because for other priority system will execute the batch jobs based on priority but for reserved category, system will reserve a percentage of batch threads. This percentage is configured in System Parameters.

No reserved capacity This value is the default value.
Low reserved capacity 10 percent of the cumulative batch threads are reserved.
Medium reserved capacity 15 percent of the cumulative batch threads are reserved.
High reserved capacity 25 percent of the cumulative batch threads are reserved.

Please note that the reserved capacity won’t be made available for batch jobs that have other priorities, even if there is idle reserved capacity. As shown below, I have 6 BatchAOS with each having 8 Maximum batch threads. Therefore, cumulative number of batch thread is 48. Now, if I set high reserved capacity in System parameters, 25 percent of the cumulative threads (that is, 12 threads) will be dedicated to processing batch tasks from the reserved queue. These 12 threads will be allocated among two AOS instances. Therefore, two of the six AOS instances will be dedicated to processing the reserved queue. If there are no batch tasks to process under reserved capacity, those two AOS instances will be idle. So, be very careful while using this option.

Testing this feature

I have enabled Priority based Scheduling at 2:50 pm in a Sandbox environment, setting Normal Priority on all Batch groups. In the below screenshots, you can see prior to 3 pm BatchAOS3 was heavily loaded and after enabling Priority based batch Scheduling, distribution was equally divided among all BatchAOS.

In conclusion, Priority based Batch Scheduling enables users to optimize the sequence of job execution and improve the efficiency of batch processing tasks. By assigning priority levels, specifying job dependencies, and scheduling jobs to run at specific times, users can have greater control over the execution of batch jobs and ensure that critical tasks are completed first. This can help to improve system performance, reduce processing time, and minimize the impact of batch processing on other system tasks.

For More info Priority-based Batch Scheduling in D365FO

Comments