Maximize Efficiency: The Ultimate Guide to Batch Jobs & Threads in D365 Finance & Operations

Maximize Efficiency: The Ultimate Guide to Batch Jobs & Threads in D365 Finance & Operations

Batch processing in Dynamics 365 Finance & Operations (D365FO) is a powerful feature that allows users to automate and streamline various tasks, enhancing overall efficiency and productivity. By leveraging batch jobs, you can schedule and execute tasks such as printing reports, performing system maintenance, and sending electronic documents without manual intervention.

In my experience, I utilized batch processing to execute the master planning engine nightly, after all users had completed their tasks. This approach ensured that all necessary data was present and remained unchanged during the execution of the master planning engine. Additionally, running the batch job during off-peak hours optimized system performance, as no users were active on the system at that time.

The batch platform provides an asynchronous, server-based batch processing environment that can process tasks across multiple instances of Application Object Server (AOS). This means that tasks are not executed immediately but are scheduled to run at a specific time.


Structure of Batch Platform

You should become familiar with the following aspects of the batch platform:

  • AOS (Application Object Server) : is a crucial component of the Microsoft Dynamics architecture. It acts as an intermediary between the client and the database, managing connections and enforcing security.
  • Batch Group : The categorization and management tool for assigning tasks to specific servers and managing their execution priorities.Batch groups are now used only to logically group jobs and to set the default scheduling priority.
  • Batch Job: This is a container for one or more batch tasks. It represents a complete process that needs to be executed
  • Batch Task: These are the individual units of work within a batch job. Each task performs a specific function, such as updating records, sending emails, or calculating totals.

To navigate to Batch Group, Follow that path : System Administration > Setup > Batch Group


Batch Group Details

You may observe a field that might not have been previously noticeable. This field, enabled through a feature, has been set to default since version 10.0.36 for existing instances. The field in question is “Scheduling Priority.

This priority is defined for batch groups but can be overridden for specific batch jobs. The scheduling priority classifications are utilized to declare relative priorities and determine the processing order of jobs and business processes. The available values for scheduling priority are Low, Normal, High, Critical, and Reserved Capacity.

Example Scenario

Imagine you have 100 batch jobs that need to be processed. These jobs are categorized into different priority levels:

  • Reserved Capacity: 40 jobs
  • Critical: 30 jobs
  • High: 15 jobs
  • Normal: 10 jobs
  • Low: 5 jobs

Priority Levels and Processing Order

  1. Reserved Capacity: This is the highest priority level. Jobs in this category are processed first. In our example, 40 jobs are in this category.
  2. Critical: These jobs are processed next. There are 30 jobs in this category.
  3. High: Jobs with high priority are processed after critical jobs. There are 15 jobs in this category.
  4. Normal: These jobs are processed after high-priority jobs. There are 10 jobs in this category.
  5. Low: This is the lowest priority level. Jobs in this category are processed last. There are 5 jobs in this category.

In this section, we have defined the job scheduling priorities for job groups. To specify system threads for reserved capacity jobs, this can be configured through a parameter within the Batch Global Settings.

  1. Go to System administration > Setup > System parameters.
  2. On the Batch global settings tab, in the Batch reserved capacity level field, select the reserved capacity level to use for batch jobs that have Reserved capacity priority:


Batch Global Settings

  • 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.

let’s assume that we have defined the priority for jobs and also specified the batch reserving capacity for threads. In this scenario, we have only defined the percentage of threads to be reserved from total threads . But what is the actual number of threads used in the Application Object Server (AOS)?

Batch capacity refers to the maximum number of batch tasks that can be processed at a time. It depends on both the number of batch servers and the number of batch threads available for processing these tasks.

To calculate the batch capacity, multiply the number of batch servers by the number of batch threads per server:

Batch capacity = Number of batch servers × Number of batch threads per server

To determine the number of threads on your running Application Object Server (AOS), navigate to System Administration > Setup > Server Configuration.


Server Configuration

In this environment, you will observe that there are two Application Object Servers (AOS) listed on the left pane.

In the Batch Server Configuration for this instance section, you will typically find that the default number of threads ranges between 8 and 12. The maximum number of threads you can use in most environments is 15. If you attempt to enter a larger number, the system will display a warning message indicating that the value exceeds the allowable limit.


Warning Message

How to increase batch capacity

To increase the batch capacity in a production environment, you must acquire more user licenses and update subscription estimates in Microsoft Dynamics Lifecycle Services. For updated user licenses, Microsoft automatically increase the batch capacity by adjusting the thread count per existing server.

The platform adds more batch servers after the existing batch servers reach their threshold limits for CPU and memory utilization.

To increase the batch capacity in a sandbox environment, you need a Tier-4 or Tier-5 sandbox. This action isn't possible in Tier-2 or Tier-3 sandboxes.



To view or add a comment, sign in

More articles by Ahmed Ali EL-Bardisy

Insights from the community

Others also viewed

Explore topics