We encounter a some slowness that we’re tracking down. Just want to leave it here to see if anyone has done the same, and I’d like to learn from you
We execute a process definition this way
return runtimeService
.createProcessInstanceById(procDefID)
.businessKey(businessKey)
.setVariables(variables)
.execute()
.getBusinessKey();
When enable TRACE level for Camunda engine we see this
- Nov 14, 2024 14:30:02.998
- ENGINE-03009 SQL operation: 'INSERT'; Entity: 'HistoricVariableUpdateEventEntity[id=fdb3c593-a2d7-11ef-9371-7ad4f1c50975]'
- Nov 14, 2024 14:30:02.998
- ENGINE-03009 SQL operation: 'INSERT'; Entity: 'ByteArrayEntity[id=fdb3c594-a2d7-11ef-9371-7ad4f1c50975]'
- Nov 14, 2024 14:30:02.998
- ENGINE-03009 SQL operation: 'INSERT'; Entity: 'ByteArrayEntity[id=fdb3c596-a2d7-11ef-9371-7ad4f1c50975]'
- Nov 14, 2024 14:30:02.999
- ENGINE-03009 SQL operation: 'INSERT'; Entity: 'VariableInstanceEntity[id=fdb39e80-a2d7-11ef-9371-7ad4f1c50975]'
- Nov 14, 2024 14:30:02.999
- ENGINE-03009 SQL operation: 'INSERT'; Entity: 'VariableInstanceEntity[id=fdb39e82-a2d7-11ef-9371-7ad4f1c50975]'
- Nov 14, 2024 14:30:02.999
- ENGINE-03009 SQL operation: 'INSERT'; Entity: 'VariableInstanceEntity[id=fdb3c595-a2d7-11ef-9371-7ad4f1c50975]'
- Nov 14, 2024 14:30:02.999
- ENGINE-03009 SQL operation: 'INSERT'; Entity: 'VariableInstanceEntity[id=fdb3c599-a2d7-11ef-9371-7ad4f1c50975]'
- Nov 14, 2024 14:30:02.999
- ENGINE-03009 SQL operation: 'INSERT'; Entity: 'MessageEntity[id=fdb54c3b-a2d7-11ef-9371-7ad4f1c50975]'
- Nov 14, 2024 14:30:05.631
ENGINE-13006 Finishing command -------------------- StartProcessInstanceCmd
it looks like it takes ~3 secs for the process instance cmd to start.
We also notice that if i keep triggering this operation, then the latency is eventually reduced; but as we leave it alone for a while it’ll be slow again. It looks like it’s some sort of batching execution like the Job Executor. But I believe that StartProcessInstanceCmd call is synchronous, so I am not sure. Hope someone can shed some light on this and suggest what I can try