cancel
Showing results for 
Search instead for 
Did you mean: 

Activiti taking too much times on transitions

mohta
Champ in-the-making
Champ in-the-making
Hello,

I'm trying to run a process , that will execute a complex activiti process for 100 000 messages. i've a performance issue, activiti engine is taking a loooong time and causes performances issues! messages are treated on 1 second ( which mean that all messages can only be treated on 27 hours!!!!)

When i did a performance studies, i found that activiti takes time on transitions between services ( about 50 milliseconds) , and on parallel gateways ( on the end of parallel gatewayes) : about 300 milliseconds! ( i logged the start / end of each service task)

I don't really know how to debug / study where it's coming from! and i don't know if it's normal?

So , have you an idea how to figure out , what's taking time?

Thanks!
8 REPLIES 8

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi,

I would use any profiling tool (the simplest one is jvisualvm in the jdk)

Regards
Martin

mohta
Champ in-the-making
Champ in-the-making
Profiling will be complicated ( i'm running my job on a distant private tomcat server ).

Well , i've a workflow , of a service task , and inside , i call a second workflow for each message to treate ( a loop of 10 000 ),

At first messages are treated fastly , but the more messages i treat , the slower my execution become.

And the only difference between the beginning of the workflow and the end , is the time of transitions
for example :
2015-08-18 23:00:51.886 service1 end
2015-08-18 23:00:52.219 service2 start


mohta
Champ in-the-making
Champ in-the-making
but for the same services : at the begin

2015-08-18 17:51:43.308 service1 end
2015-08-18 17:51:43.333 service2 start

vasile_dirla
Star Contributor
Star Contributor
Hi,
could you provide a unit test for it?
I guess you already have the code which show this behaviour.
Thanks.

mohta
Champ in-the-making
Champ in-the-making
not really , i don't have the code right now..
but to make short , i've a task which contains a loop that will run an activiti process ( with sub processes) ( by message) for 100 000 message.

At first , execution for each notification lasts 900 milliseconds, but the more i treat messages, the more my execution time lasts ( at last , i obtain a 5 seconds for each messsage)

I'm wondering if activiti keeps the complete execution context for all messages until i finish my loop and don't commit it until the main task is over, could it be the reason? and if it is , is there a way to commit the context , or flush the memory?

thanks a lot

trademak
Star Contributor
Star Contributor
If you don't show any code we can't really comment on this. It's definitely not normal to have 900 ms delays for these kind of actions. So it would be good if you can share more details so we can try to reproduce the issues you are seeing.

Best regards,

mohta
Champ in-the-making
Champ in-the-making
I coan't paste code ( i'm in work , and it's not allowed to post code on internet)

I discovered , that while executing my loop , activiti context is getting more and more heavier ( i  suppose that for iteration 1 it keeps the execution context of the iteration , and for iteration 2 , it keeps execution of 1 and 2 … until n : it keeps the execution of all iterations)

Which make activiti memory heavier and heavier!

Is there any way to loop diffrently ? using an activiti feature? that free memory for each iteration?

I tried modeling the loop with an exclusive gateway , but i get the same error.

I suppose that activiti only flush memory on commit?

Thanks

vasile_dirla
Star Contributor
Star Contributor
Hi,
yes, you are right; is not ok to post proprietary code. (we all know that)

I was expecting you to create a unit test simulating the same scenario you did at work (it's just a similar algorithm not a clone of the proprietary code).

I think you understand that is not easy to debug an issue unless you reproduce it first of all.