i have a process which is retrieving batch of cases and then pushes these cases into a multi instance imbedded sub process, and this embedded sub process contains a sub process which calling another process definition. the issue is if i have a 100 cases pushed to the multi instance imbedded sub process it works fine in parallel until it reaches the inner sub process then it starts to work in sync not in async way.
the main goal is to get the inner sub process trigger another process instances based on the multi instance number and let all of them work at the same time, but the fact that these are being triggered but its not working in parallel. for example, there is an instance which takes 10 seconds to get completed, but when i have 10 instances running at the same time the turn around time is getting increased to be 30 seconds for each instance which means the more instances i have the more time it takes to be get completed.
Hello @Laith.Othman,
The described behaviour is correct by design. A CallActivity starts a new process instance which runs in a separate thread. Your multi instance subprocess will wait until all of these process instances are finished. As the engine has a ThreadPool to execute jobs (which in fact is the newly created process instance) only a limited amount can be executed at a time. You can configure the pool size.
Hm, What about ~ 50?
You will have to adjust the queue size as well, so that the job acquisition thread can put enough jobs into it.
As each of these job execution threads will fire the database you need to ensure proper database connection pool settings, too.
Tweaking the job thread pool usually is a game of trial&error, do increase in small steps and measure the performance to compare!
@McAlm
Yeah i can see, but my concern that i increased the pool size with different values and tried with many scenarios and im still getting the old results specially service tasks are taking too much time when there is more instances, for example if a service task was taking 1 second for one instance, it will be taking 20 seconds fot each instance when there is 50 instances.
noting that i havent changed any of the DB configs