Job Executor / acquisition configuration issue for timer task - spring boot application

Hi Everyone,

We have a timer event scheduled for say 2 minutes, When there are high number of requests which are scheduled at the same time say 100 requests at the end of 2 mins all the 100 requests should be processed but it s taking about 1 to 2 mins for all 100 requests to complete.

We would want all 100 requests to be processed as soon as the 2 min wait expires.,

I read https://docs.camunda.org/manual/latest/reference/deployment-descriptors/tags/job-executor/ accordingly we configured as below.

appplication.yaml file:
camunda.bpm:
job-execution:
max-wait: 1000
max-jobs-per-acquisition: 500
core-pool-size: 100
max-pool-size: 100
queue-capacity: 100

Also after reading other posts i tried to provide configurations using java configuration as

Java Class
@Bean
@Qualifier(“camundaTaskExecutor”)
public TaskExecutor camundaTaskExecutor() {

	System.out.println("configuring camundaTaskExecutor");
	
    final ThreadPoolTaskExecutor threadPoolTaskExecutor = new ThreadPoolTaskExecutor();

    threadPoolTaskExecutor.setCorePoolSize(50);
    threadPoolTaskExecutor.setMaxPoolSize(200);
    threadPoolTaskExecutor.setKeepAliveSeconds(5);

    return threadPoolTaskExecutor;
}

but still the results are the same.

The application is of Springboot and camunda version is 7.12.

I am not sure whether the configuration done is not being read or there are other properties to be configured to archive this. Please help.

@ManoharG refer this post:

wait-time-in-millis Specifies the wait time of the job acquisition thread in milliseconds in case there are less jobs available for execution than requested during acquisition. If this is repeatedly the case, the wait time is increased exponentially by the factor waitIncreaseFactor. The wait time is capped by maxWait. 5000
.max-wait Specifies the maximum wait time of the job acquisition thread in milliseconds in case there are less jobs available for execution than requested during acquisition. 60000

@aravindhrs Thanks for reply.

I had referred this post and accordingly max-wait is set 1000 (1s) and max-jobs-per-acquisition is 100,(this works fine for individual request) So with this configuration irrespective of wait-time-in-millis Every 1 second 100 requests or how much ever available at that second should be picked and processed but even though there are 100 request due in the span of 10 secs it takes about 3 mins to complete.

@ManoharG, it seems your jobs are running more than 1 sec to complete the tasks. In that case, threads are still executing the tasks and there’s a delay in processing the requests. You might consider in horizontal scaling of camunda server, so the task will be evenly distributed across nodes and will be executed in less time than single node system.

You’ve queue capacity also to 100, lets say in batch1 100 tasks are acquired by acquisition thread and processed by worker threads. You’ve set max-pool-size to 100 and if the task took more than a second for execution, worker threads will be blocked. Meanwhile acquisition thread will pull tasks for batch-2 execution. In cycle, at certain state queue will be full and untill the worker threads completes the task, acquisition thread wont pull tasks for batch-3, unless the queue is empty. So this waiting state will lead into delay in task execution. Your expectation will be achieved only if task and threads are directly proportional.