OptimisticLockingException - Entity was updated by another transaction concurrently

Dear All,

We have designed a camunda BPMN from which parent workflow makes a call to sub-workflow using BPMN “Call Activity” object and submits a list of tasks to the sub-workflow as “In-mapping propagation”.

Note: We are using Camunda Platform Engine 7 and it’s deployed K8s environment and running inside a POD.

Inside our parent workflows, and sub-workflows, we have mostly utilised the BPM Service Task Object (with “External” type Java implementation).

Ever since we have moved to production, we have observed that the scale of data that was processed by the external service tasks has gone upto 1000 times as compared to the time during development, and because of that we started seeing a lot of performance issues at each of the service tasks.

In order to make those performance improvements;
we did few changes to our deployment model (Increased the number of PODs running for camunda process from 1 to 6)
and did some configuration changes with respect to creation of ExternalTaskClient. We started setting up maxTasks in the ExternalTaskClient. We started using the value for it as 20.

We observed that the camunda workflows started completing in better time. However, still the overall time taken is huge and is not what the customers are expecting.
Another issue we started seeing is a lot of OptimisticLockingException in log files.
ENGINE-REST-HTTP500 org.camunda.bpm.engine.OptimisticLockingException: ENGINE-03005 Execution of ‘UPDATE PropertyEntity[next.dbid]’ failed. Entity was updated by another transaction concurrently.

Could you please help us here and suggest what should be the right approach to handle data at scale and still achieve better performance with the camunda platform engine and kind of bpmn objects we are utilising in our workflows?

Looking forward to your response and insights on this use-case. Any help would be greatly appreciated.

Regards,
Ishan Aggarwal

Hi @Ishan_Aggarwal,

Below best practices docs might be of help to you (Processing high numbers of parallel activities)

Thanks @hassang for your immediate response. Let me go through the details for Performance tuning Camunda 7 to help understand it better.

I will get back to you if there are any questions.

Thanks,
Ishan Aggarwal