Timer Task - Delay

Hi All,

I am trying to run a timer task in Camunda, however, the task is running with a delay of approx 30 seconds after the scheduled time. So, if the timer is supposed to run after 5 mins, its actually running after 5 mins 30 secs. I tried changing the value of maxWait to as low as 1 sec but without any benefit. Has anyone else faced similar issue? Any suggestions would be appreciated, thanks!

@Shreyoshi_Das, Sometimes there will be delay in triggering timer events and depends on the number of jobs being executed in engine at that time. For more details refer this post:

Thanks for this but I have the requirement for the timer tasks to be executed after a specific interval. Are you saying this is not achievable at this precision in Camunda? Also, as of now, this is the only timer task I am configuring, so it should not be an intensive polling, isn’t it?

@Shreyoshi_Das there won’t be much delay in timer execution. And jobs is inclusive of activities enabled with async flag. Timer event ensures that it will fire the event after the time lapses and not before. So if you found any delay it’s completely depends on the thread resources available in the system.

@aravindhrs There is a delay of around 30-45 secs to my tasks which is not acceptable for the requirement. Hence the ask, is there any property which can help in reducing the polling time? Or should I look at making maxJobsPerAcquisition as 1?

If multiple instances running and having same time for timer event it will be executed based on configuration filter (max jobs).

I would suggest that you can scale up the camunda instances, might reduce the execution time in firing timer event by balancing the load across the different nodes in the cluster.

No, its a small process, and I just tried making it as 1 without any difference. Ideally a timer task should be triggered at the exact time, like in other schedulers. Does Camunda lack that precision?

Hi @Shreyoshi_Das,

maybe you placed the maxWait configuration in the wrong place so the engine couldn’t pick it up.

Could you please add more details about your platform and post the complete configuration flie here?

Hope this helps, Ingo

Hi, I have placed the bpm-platform.xml in the META-INF folder, attaching the same here, even I had a doubt whether this is the right file coz there was no change when I increased the value to 90000 or so.bpm-platform.xml (592 Bytes)

Hi All, anyone has any idea on this?

Hi,

are you using SpringBoot? If so, perhaps change these properties in application.yaml

See docs here.

Also a value of 1 is 1 millisecond. Perhaps start with a value closer to 5000, eg 5 secs, otherwise you may get CPU or resource starvation in the DB as the acquisition thread hammers the database when there are no jobs…

regards

Rob

2 Likes

Hi @Shreyoshi_Das,

Configuring process engine is depending on whether you use an application managed or a shared, container managed process engine.

Could you please specify more details about your setup.

Thanks a lot, this worked after adding the entry in application.yaml