Hello,
My team has a Node based app with some Camunda workers. One of these workers does what it is supposed to do, and as its last step it makes a series of sequential calls to the Complete External Task route.
Specifically, it is making 11 calls, one at a time, to complete 11 tasks. It does this quite quickly, but we noticed that CPU usage spikes during these calls, often up to 80-86% in my dev environment.
I’ve verified these calls are what is causing the spike by setting a breakpoint, letting the app pause before the calls, and then letting the calls execute. See the image below:
I was able to decrease CPU usage by over half by simply adding a 300ms pause between each request, but that feels like a Band-Aid that shouldn’t be necessary.
Here is how our worker is set up (we are using camunda-worker-node):
const processSplitsWorker = new Workers(configMgr.config.camundaUri, {
maxTasks: 1,
pollingInterval: 100000,
use: [
CamundaWorkerLogger,
CamundaWorkerMetrics
]
});
And where we subscribe:
if (camundaWorkers.includes("processSplits")) {
processSplitsWorker.subscribe('cmeProcess:processSplits', {lockDuration: 60000},
processCMESplits);
}
And then we are making calls to /task/:taskId/complete. Everything works, but the CPU usage is high. Is there any way we can increase the performance of these calls? There seem to be a myriad of Camunda settings that can aid in performance, but I’m not sure where to start.