Timer Execution too slow

Hi there!
Using the camunda 7.4.0/7.5.0 Tomcat bundles I have the problem that timer events are fired too late. (Side note: It was working fine with earlier versions)

In a simple process between two tasks there should be a waiting time of 10 seconds. This is modeled as a simple intermediate timer catch event using a PT10S definition.

As can be seen in the job-log the job is created correctly:

   <e>
      <activityId>IntermediateCatchEvent</activityId>
      <creationLog>true</creationLog>
      <deletionLog>false</deletionLog>
      <deploymentId>186c6049-28c6-11e6-8794-340286d0c0d1</deploymentId>
      <executionId>9985b18a-28c6-11e6-b6d7-340286d0c0d1</executionId>
      <failureLog>false</failureLog>
      <id>998674dd-28c6-11e6-b6d7-340286d0c0d1</id>
      <jobDefinitionConfiguration>DURATION: PT10S</jobDefinitionConfiguration>
      <jobDefinitionId>1874287c-28c6-11e6-8794-340286d0c0d1</jobDefinitionId>
      <jobDefinitionType>timer-intermediate-transition</jobDefinitionType>
      <jobDueDate>2016-06-02T15:33:42</jobDueDate>
      <jobExceptionMessage null="true"/>
      <jobId>998674dc-28c6-11e6-b6d7-340286d0c0d1</jobId>
      <jobPriority>0</jobPriority>
      <jobRetries>3</jobRetries>
      <processDefinitionId>Timer_IntermediateEvent:1:1874287b-28c6-11e6-8794-340286d0c0d1</processDefinitionId>
      <processDefinitionKey>Timer_IntermediateEvent</processDefinitionKey>
      <processInstanceId>99217175-28c6-11e6-b6d7-340286d0c0d1</processInstanceId>
      <successLog>false</successLog>
      <tenantId null="true"/>
      <timestamp>2016-06-02T15:33:32</timestamp>
   </e>

But executed too late:

   <e>
      <activityId>IntermediateCatchEvent</activityId>
      <creationLog>false</creationLog>
      <deletionLog>false</deletionLog>
      <deploymentId>186c6049-28c6-11e6-8794-340286d0c0d1</deploymentId>
      <executionId>9985b18a-28c6-11e6-b6d7-340286d0c0d1</executionId>
      <failureLog>false</failureLog>
      <id>c0055770-28c6-11e6-b6d7-340286d0c0d1</id>
      <jobDefinitionConfiguration>DURATION: PT10S</jobDefinitionConfiguration>
      <jobDefinitionId>1874287c-28c6-11e6-8794-340286d0c0d1</jobDefinitionId>
      <jobDefinitionType>timer-intermediate-transition</jobDefinitionType>
      <jobDueDate>2016-06-02T15:33:42</jobDueDate>
      <jobExceptionMessage null="true"/>
      <jobId>998674dc-28c6-11e6-b6d7-340286d0c0d1</jobId>
      <jobPriority>0</jobPriority>
      <jobRetries>3</jobRetries>
      <processDefinitionId>Timer_IntermediateEvent:1:1874287b-28c6-11e6-8794-340286d0c0d1</processDefinitionId>
      <processDefinitionKey>Timer_IntermediateEvent</processDefinitionKey>
      <processInstanceId>99217175-28c6-11e6-b6d7-340286d0c0d1</processInstanceId>
      <successLog>true</successLog>
      <tenantId null="true"/>
      <timestamp>2016-06-02T15:34:37</timestamp>
   </e>

In the documentation I read about the jobExecutorPreferTimerJobs and jobExecutorAcquireByDueDate properties - but setting those to true in the bpm-platform.xml file in the tomcat conf directory does not help.

Any hints how to speed up the timer job execution?

Thanks!
Matthias

1 Like

Hi,
Another area to look at is when the job executors are idle, they can sleep.

Also note that a timer guarantees that it won’t fire before the time interval…load and config will determine when it actually fires…

Rob

3 Likes

Thanks Rob for that input!

I was able to solve my issue now by changing the maxWait time for the job executor form the default value of ‘60000’ to ‘5000’, i.e. (as far as I understood it), now at least every 5 seconds it is checked whether a job is due.

(Side note: This seems to be fine in our quite special use case with rather short timers that should be executed quickly after being due - but I noted that this change caused rather heavy CPU usage. So be careful if you try to use this in production use.)

1 Like