TaskService query very slow even for small amount of data

Hello Camunda team,
I am a new member to this and recently started using Camunda.
We have following code snippet which is taking lot of time. As much as couple of seconds to get executed.
Note that the test system I have is only with one process instance which has less than 10 activities inside. So data is not that huge.

TaskService taskService;
Task curentUserTask = taskService.createTaskQuery().initializeFormKeys().active()
.processInstanceId(String.valueOf(executionId))
.orderByTaskCreateTime()
.asc().singleResult();

Any quick help greatly appreciated. This query we are calling as part of a Usertaks. That means there is a UI which experiences slowness.

Hi and Welcome to the Forum

Are you also following (or perhaps working with the poster from) this thread

What is your environment? Camunda Run? Camunda 7 with External Tasks? Are you using the embedded H2 database or some other DB?

Hi,
What is your environment - We use Camunda Run with spring boot.
Are you using embedded H2 or Some other - We use PostGreSQL.

Let me know if you need more details

Regards
Gopal

Yes, we both are on the same problem.

The camunda version we are using is 7.13

7.13 is a bit of an older distribution.
Have you considered testing this against 7.19?

If this is something that it urgent to your organization, instead of asking a peer-collaboration site, have you considered getting a support agreement from Camunda?

We tried with 7.19 with same results. One can reproduce it easily, if you query the TaskService via
REST APIs.

@GotnOGuts Since we are using open source version of camunda hence we don’t have enterprise level support available.

Any help anyone? We need one thing. If someone confirms that TaskService API for community edition of platoform 7 is slow in general that will also be enough for us. Are there any issues reported for slowness for the TaskService?

What we are trying to do is as below
We have used Cmunda Human Task for our UI applications. For example if we need some input from UI or send some response from backend to UI, human task service will be used. We want to get the current task (active task) and from that will get “input_vartiables” and “output_variables”. Also once UI actions are done, we need to mark the task as complete. Hence we use TaskService API.
Is there any alternate way?

Regards
Gopal

Hi @Gopalkrishna_Kulkarn,

the response time of the TaskService depends on the database content.

Additionally, the form key is not saved in the database and merged into the result set from the BPMN diagram.

The logging level for the database traffic may help you to get more details about your setup and where the time is spent: Logging | docs.camunda.org

Hope this helps, Ingo