Handling bulk timer events


In our BPMN process, we are using timers(configured to run every 5 minutes) and on execution of timer, a service task(asynchronous: true) will be execuuted which has an external service call. If that external service doesn’t returns expected response, then the process will move back to the timer and execute again after 5 minutes.

This is working fine with less number of instance. But with bulk instances we are facing some performance issues. We have tested our process with 100 thousand instances and it created 100 thousand timers. All timers are configured to run every 5 minutes. It took around 10 hours to complete execution of all timers and move forward. Can you please help me how to design my process in better way to avoid these kind of performance issues. Is there any configuration that i need to do to make process to execute faster.

Also please help me to understand how these timers will be picked and executed by flowable?? Does it pick all timers at once or is there any queueing implemented in the framework??

Thank you,

Timer jobs are picked up by the async executor after their time has expired, similar to tasks with the async flag. If you are overloading the async executor, you have two options:

  1. Increase the pool size
  2. Add additional instances of the flowable engine

Either option will increase the pool of executors, but option 2 gives you the ability to distribute the compute load if that is needed. Note that both options will increase the number of connections to the database, you may need to tune the connection limit on the database side to keep up with demand.