Is there any documentation of how to maximize performance when using the camunda-external-task-client-java library [0] ? Trying to find a balance between responsiveness (tasks are picked up and completed quickly), database load (not too many big queries on the DB), throughput (keeping up when a large number of process instances are being started), and service CPU usage. We’re also unclear about how the library works with multiple stages/topics, and whether they should use individual ExternalTaskClient objects, share them, thread pool them, etc., particularly with respect to a somewhat large number of different stages (we have 17 different stages that are executed in external-task implementations).
Initally we used a single ExternalTaskClient, which we had all of our stages use to subscribe through, and with a low maximum backoff (50ms between requests). We were trying to maxmimize responsiveness, but that placed a quite high load on our DB, and couldn’t keep up when we needed higher task throughput.
We then switched to using a couple separate ExternalTaskClient objects, because we thought the library might not efficiently “share” one across multiple topic subscriptions. Some of these ExternalTaskClients had a higher or lower MaxTasks setting, depending on how quickly the work would complete. This helped, but still didn’t seem to give us the throughput we expected in stages that were sharing an ExternalTaskClient among multiple stages.
That led us to switching to a model where each stage used its own ExternalTaskClient, but we’re finding that this is resulting in quite a high CPU usage for our service.
The only documentation I’ve been able to find for performance tuning this is here [1], and it’s extremely limited. I can’t tell if the TopicSubscriptionManager [2] is safe or performant to share among multiple stages each subscribed to different topics. Is there any further documentation with details about what the cost/benefit tradeoffs are of adjusting different settings in this library?
[0] GitHub - camunda/camunda-external-task-client-java: This codebase was merged with https://github.com/camunda/camunda-bpm-platform. Only some maintenance branches might still be active.
[1] External Task Client | docs.camunda.org
[2] https://github.com/camunda/camunda-external-task-client-java/blob/master/client/src/main/java/org/camunda/bpm/client/topic/impl/TopicSubscriptionManager.java