HomeDynamics 365Business CentralFriday Tips #4: Efficient Use of Multiple Users for Job Queues in...

Friday Tips #4: Efficient Use of Multiple Users for Job Queues in Dynamics 365 Business Central

Hi Readers,

Recently, Microsoft updated the operational limits in Dynamics 365 Business Central, shifting the limitation model from being environment-based to user-based. This change affects how job queues and background sessions operate. Instead of sharing limits across the entire environment, each user now has their own set of limitations. This opens up opportunities to optimize background tasks more efficiently.

What’s Changed?

Previously, the number of background sessions and job queues that could be executed simultaneously was limited to 3 scheduled tasks per environment. This meant that when there were a large number of background tasks, only 3 could run at the same time, and additional jobs could be delayed because the environment was already operating at its limit.

With the new update, from Q1CY24, Microsoft has applied a limit of 5 concurrent scheduled tasks per user. This means that each user can now run up to 5 background tasks independently, improving the overall throughput of background jobs and reducing delays caused by resource contention, as opposed to the previous environment-wide limits.

Concurrency limit for scheduled tasks

Old: 3 concurrently running tasks per environment

New: 5 concurrently running tasks per user

Microsoft Doc:

New operational limits on scheduled tasks and web requests improve throughput | Microsoft Learn

Operation Limits in Dynamics 365 Business Central – Business Central | Microsoft Learn

Test

I created a codeunit with a 5-min sleep to simulate long-running tasks, then set up the job queue to run multiple instances simultaneously to test the per-user limits.

Previously, we were only able to run 3 job queues simultaneously. With the recent update, it’s now possible to run up to 5 job queues concurrently for each user.

If you set up job queues with different users, you can run multiple job queues simultaneously per user, without being restricted by the environment limit.

This approach is very useful in systems with a high workload or that need to run multiple background tasks. Distributing job queues across different users allows more tasks to run concurrently, ensuring smoother system operations and avoiding resource bottlenecks.

Monitor the background sessions run by job queues directly in the Admin Center:

You can also run 5 job queues concurrently across different environments with the same user:

Quick Tips:

  1. Distribute job queues across multiple users: This avoids overloading a single user and allows more jobs to run simultaneously.
  2. Assign heavy jobs to dedicated users: Prevent large tasks from slowing down other processes.
  3. Monitor per-user limits: If one user hits the limit often, spread the tasks to other users.
  4. Optimize child sessions: Ensure each user can handle child sessions without exceeding their limit.

The shift to user-based limits is a significant improvement, offering greater flexibility and more efficient job queue management. By leveraging multiple users and strategically distributing tasks, you can ensure smooth operation even in complex, high-demand environments. Remember, understanding and applying these limits effectively will allow you to get the most out of Dynamics 365 Business Central. Happy coding, and stay tuned for more tips next Friday!

RELATED ARTICLES