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.,
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.
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.
Sorry for delayed response… Thanks aravindh… the further process is what was causing delay, working on synchronizing no of threads w.r.t further process.