Limiting the Number of Jobs Running in Parallel

When the execution of a task is launched, it runs in a dedicated thread of the Execution Service. The resources that this job requires add up to the microservice consumption. To manage this, there is a limit on the number of jobs that can run simultaneously in the Execution Service, with a default of 5. When this limit is reached and a new job is launched, it is queued until a running job finishes. This queue is by default unlimited.

The parameters that control the above are the following:

  • services.execution.maxConcurrentJobs controls the maximum number of jobs that can run simultaneously in the Execution Service. It defaults to 5.

  • services.execution.maxQueuedJobs controls the maximum number of jobs that may be queued waiting for a running job to finish. It defaults to 0, meaning that the queue is not limited. If the queue is limited and full, any new job is rejected and terminates with status FAILED.

They are Spring properties, and can therefore be overridden by the standard Spring mechanisms, typically environment variables set in the Docker configuration. For more details, please refer to Section Using Docker Configuration Files.