Hello.
We’re testing multi-instance tasks and their execution parallelism. After some tests, it seems that despite a parallel setting, task instances, generated from a pool variable array, are executed in a sequential way, and not actually parallel : when storing tasks results in an array, they appear in the same order as the source collection, that seems to be very strange, without any random factor as expected…
How can we handle the way the Bonita’s engine schedules parallel tasks ? I’ve read some indications about the worker service thread pool configuration, but, according to the documentation, the default 25 threads may execute parallel tasks… Other things to set up ?
Thanks in advance.
Regards.
I’m not sure what your problem is, and I don’t believe there is a problem.
Are you looking for randomisation or just multiple parallel activities? You also do not say whether these tasks are Human or automatic (script).
The way the system (I suspect having not read the actual code) works is:
Get instantiation request
get instantiation size (say 1-100)
start process at 1, then 2, then 3, then…to 100
It is then up to the java engine to execute the processes, which I suspect due to the way these systems work is process A, then B, then C etc…
regards
Seán
PS: While I understand this may not be the answer you are looking for it does answer your question, please mark as resolved by ticking the tick mark on the left of this reply so others now it is closed.
Hello.
Sorry, I’ve not said before that this is a system task, and so that instances may be executed actually in an automatic parallel mode.
My question is about this parallelism that seems to be ignored by the engine : looking the results of the execution, instance from the first element in the list is executed first, then the second element, et so on, while we expect Bonita to run parallel executions.
There is not much details about the threading mechanism in the documentation when parallel multi-instance task are executed. Some part of the documentation says something about the Worker Service and the pool configuration about the threading tunings, but nothing seems to explain what participates to multi-instance parallelism…
It’s very important for our case : we must know how many parallel tasks from multiple cases may be executed concurrently to define the system sizings, to have control on overload, and configure others components too (web services servers in this case).
Is it clearer ?
Thanks again for your help.
Regards.
Are you sure you’re using parallel in the multi-instantiation and not sequential? We’ve done that before by mistake.
regards
Hello.
Yes, I’m sure that parallel is selected, in BOS, and also in the BPMN :
<elements xmi:type="process:ServiceTask" xmi:id="_cEB9j6aDEea0nYlEtpE3CQ" name="Traiter" outgoing="_cEB96aaDEea0nYlEtpE3CQ" incoming="_Mlad0KaEEea0nYlEtpE3CQ" type="**PARALLEL**" collectionDataToMultiInstantiate="_cEB90KaDEea0nYlEtpE3CQ" outputData="_cEB9lKaDEea0nYlEtpE3CQ" listDataContainingOutputResults="_cEB91aaDEea0nYlEtpE3CQ" storeOutput="true">
That’s why I’m rather surprised that with 5000 or 1000 elements, parrallel executions always lead to a perfect sequential output in the results collecting list.
As I know nothing about the way Bonita launches the task (multithreaded ExecutorService ???, single thread ???) I’ve doubts about the targeted real parallel behaviour.
Our test task for now just updates pool variables, and doesn’t produce any IO or external system call. Is it possible that for that reason the process case itself becomes a lock and makes all the task wait “sequentially” for starting or ending, and thus no concurrent execution is actually possible ?
I’ve just noticed this very important comment in the documentation:
Performance tuning
Note: For Performance edition only.
from: http://documentation.bonitasoft.com/?page=performance-tuning
So here is another question - are you using Performance or Efficiency Edition?
Because if not then all this research will be for nothing if using Community.
However If you are using a Subscription model of the software I would simply ask your Bonitasoft Support agent to assist. Subscription questions like this are a little outside the knowledge and scope of the Community Forum. You’ll definitely get an answer from them.
regards
Seán
PS: While I understand this may not be the answer you are looking for it does answer your question, please mark as resolved by ticking the tick mark on the left of this reply so others now it is closed.
Hello.
You’re right : these performance tunings only applie to subscription editions, and unfortunately we only can use a community one.
Anyway, I hope that someone that also uses multi-instantiated tasks may give us a feedback about their parallel execution or not : if I’m not wrong, this feature is not marked as “subscription versions only”, and I supoose that something shlud be possible to control parallelism.
I will also add some more complex work to my tests (database access, web service call, etc.) to ckeck if this introduce some kind of latency and make task ending in a random order, or, at contrary, the sequential mode we’ve noted remains the same.
Thanks for you help.
Regards
Hello.
After some tests I can confirm that the BPM engione actually executes multi-instantiated in parallel mode. My doubts came from the apparently ordered results list that seemed to suggest a sequential execution.
I’ve added a web service connector to my task, and from the server side, we can effectively see the concurrent calls.
What remains unclear is the threading model of this concurrent multitasking : observing the maximum running threads count and opened TCP sockets number, executing the tests from the studio, Bonita seems to limit parallel tasks to 2 or 3. But no parameter seems to match this behaviour…
In a future production system, how can I set a predicted threading model, and set up either a limited pool size, to avoid overload, either more processes to allow a more speedy excecution for thousands of tasks ?
Thanks again for your help.
Regards.
I’ll be honest I think the size of this thing demands a subscription edition.
Talk to Bonitasoft and see what you can find out, otherwise I’m afraid I can’t help any further because I don’t know.
regards and good luck