Parallel Run is not working for a sub process located inside a Multi Instance imbedded sub process

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.

any advise on that?

Hi @Laith.Othman,
Can you share your (simplified) BPMN Process?

Best, McAlm

@McAlm here is the part that im talking about

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.

1 Like

@McAlm
Yeah that perefectly understood.could you please provide where to configure the pool size?

Thank you

That depends on the type of your environment:
Springboot Application or Camunda-BPM Run:

Otherwise have a look here:

@McAlm

Its Apache tomcat 7.13 starter

Then please find the bpm-platform.xml and put the configuration there as described in the docs.

thank you @McAlm, will check that.

btw, what is the ideal pool size properties values to be able to run in parallel for example for 50 instance at the same time?

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

What are your service tasks doing? This actually sounds to like as your service task implementation is not able to handle more requests…

@McAlm its calling third party APIs using connectors