Bonita 5.x engine performance

Hi,

I'm using Bonita 5.10 community deploy on glassfish with Oracle database.

This works fine when i launch small process.

But now, I need to launch an automatic process which must do several iterations inside a loop to handle an unknown number of files in a folder. The matter is that the time of each iteration growth.

Iteration 1 is done in 10 secs.

iteration 100 is done in 20 secs

iteration 500 is done in 1 mn !!

... etc

 

I can reproduce the case with a process that only use a bonita connector to set the value of a variable at each iteration so the spent time must come from the engine.

I think that the problem is probably coming from the managing of some hibernate queries which return more and more records at each iterations.

 

Is there something to do to optimize the bonita engine or this kind of process ?

 

 

This is a screenshot with 6.x, but this possible to do the same in 5.x.

This is not good at all to do a loop in the diagram.

Hi,

Thank you for your answer.

I did some tests using an iteration loop instead of my old diagram loop.

There is a very few time gain when I use the iteration loop, but each iteration time continue to growth too much.

Furthermore, I now have a StackOverflowError with the new iteration loop that I don't have with my old diagram loop.

Does Bonita have some limits to the number of automatic activities that can be chains ?

 

java.lang.StackOverflowError
    at java.io.FileOutputStream.writeBytes(Native Method)
    at java.io.FileOutputStream.write(FileOutputStream.java:260)
    at java.io.BufferedOutputStream.write(BufferedOutputStream.java:105)
    at java.io.PrintStream.write(PrintStream.java:430)
    at sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:202)
    at sun.nio.cs.StreamEncoder.implWrite(StreamEncoder.java:263)
    at sun.nio.cs.StreamEncoder.write(StreamEncoder.java:106)
    at sun.nio.cs.StreamEncoder.write(StreamEncoder.java:116)
    at java.io.OutputStreamWriter.write(OutputStreamWriter.java:203)
    at java.io.Writer.write(Writer.java:140)
    at java.util.logging.StreamHandler.publish(StreamHandler.java:192)
    at java.util.logging.ConsoleHandler.publish(ConsoleHandler.java:88)
    at java.util.logging.Logger.log(Logger.java:458)
    at java.util.logging.Logger.doLog(Logger.java:480)
    at java.util.logging.Logger.log(Logger.java:569)
    at org.ow2.bonita.runtime.model.ExecuteNode.handleException(ExecuteNode.java:92)
    at org.ow2.bonita.runtime.model.ExecuteNode.perform(ExecuteNode.java:75)
    at org.ow2.bonita.runtime.model.Execution.performAtomicOperation(Execution.java:447)
    at org.ow2.bonita.runtime.model.Execution.performAtomicOperation(Execution.java:434)
    at org.ow2.bonita.runtime.model.Execution.beginWithOneStartNode(Execution.java:155)
    at org.ow2.bonita.facade.runtime.impl.InternalProcessInstance.begin(InternalProcessInstance.java:181)
    at org.ow2.bonita.definition.activity.SubFlow.executeBusinessLogic(SubFlow.java:161)

 

Mark your task as assynchronous (uncheck "synchronous" box from the studio) - See more at: http://community.bonitasoft.com//answers/bonita-5x-engine-performance#comment-35323

Hello, how did you do the loop ?

I use a XOR gate after my automatic tasks with 2 outputs.

The default output go to the end

The other output go before my automatic tasks and has a condition like this : i <= nb_iteration

I also try to use subprocess for my automatic tasks with the same result.

 

Hello,

does this change anything if you mark your task as assynchronous (uncheck "synchronous" box from the studio)?

Hi,

I made some tests with the task mark as assynchronous as you said.

My process take now 3 times less to perform and without any crash so your idea works very well, thank you :)

I can even increase the value of the attribut "threads" in bonita-server.xml file to get better result.

Great! I'm putting that as a answer.