2

According to Apex Developer Guide, the limits on Batch Apex are the following:

  • Maximum number of batch Apex jobs in the Apex flex queue that are in Holding status: 100
  • Maximum number of batch Apex jobs queued or active concurrently: 5

What is the difference between Apex flex queue and jobs queued? What are the real limits on queueing different Batches that execute in more than one job (for the same user)?

2

When Apex Flex Queue did not exist (pre Spring '15), you could have only initiated maximum of 5 batch jobs to be run. The actual execution of the batch jobs definitely depends whenever the resources are available. This "active" queue of 5 jobs is what is known as the batch job queue.

Starting Spring '15, when Apex Flex Queue was generally available, the limit to "queue" batch jobs was extended to 100 and that all such jobs were in the status as "holding". The actual "batch job queue" is still 5. That means that as and when the batch job queue get cleared, a new job from apex flex queue is then added to the "batch job queue" to be executed. Refer to the below excerpt from the release notes:

This update doesn’t change the way you submit batch jobs but enables you to submit more batch jobs than before. This update doesn’t affect the existing behavior of processing batch jobs after they’re queued. The Holding status has been added for batch jobs, which might affect queries against AsyncApexJob.

Previously, you could submit only up to five batch jobs simultaneously. The Apex flex queue enables you to submit up to 100 additional batch jobs for execution. Any jobs that are submitted for execution are in holding status and are placed in the Apex flex queue.

As for the real limits, they are still as what is mentioned in the documentation. If either of the governor limits, 5 for batch job queue or 100 for flex queue is reached, the platform then throws exception.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.