Reduce REST API Response Time

We are creating a SpringBoot application with the embedded Camunda Platform 7.13 and External Task Client and deploying it to AWS EC2 instance of c5.4xlarge (16 CPU and 32 GB RAM). The database is the MariaDB which is also hosted on AWS EC2 instance with the same zone of the application server. We have conducted the Performance Testing on various user load. Each user load ran for 15 minutes. We got the average REST API Response Time from 1.7 seconds to 2.8 seconds (for 1 user to 100 concurrent users). The DB Query shows that the total duration for the API call (i.e., BPMN & DMN processes) was around 0.4 seconds.

Questions:

  1. Any ideas why it took over 1 second to return the API response after the BPMN/DMN engine processes?
  2. Is there a debug log to check all processes before and after the BPMN/DMN engine execution, including data transfer in the network?
  3. Is there anyway we can turn the parameter to get the response time under 1 second?

Can you detail which rest calls you’re using and the model that you’re calling.
There are lots of possible reasons.

Hi Niall, Thanks for your quick response.
It is an in-house API we built which invokes two simple BPMNs and few more DMNs. The total execution time (DURATION_) is 0.4 seconds in ACT_HI_ACTINST table. Is there any other tables I need to check for the entire process time?

Camuda 7 is transactional so its possible (depending on your model) that the api call is returning to the engine and doing a bunch of extra stuff before returning.
You can create transaction boundaries explicit before and/or after element by using the asynchronous tick boxes.

What you’re measuring with that table might be the time it takes for a task to be completed from the moment it’s created - that could be misleading because there might be some time between when the task is created and when the external task picks it up to work on it. That of will depend on your settings. Using long polling should solve that.

If you’re very concerned with performance I suggest you check out Camunda 8. It’s even based so it’s a lot faster.

How to we set the long polling?

The following are our settings:
spring.datasource.hikari.maximumPoolSize=20
spring.datasource.hikari.connectionTimeout=20000
spring.datasource.hikari.minimumIdle=5
spring.datasource.hikari.idleTimeout=300000
spring.datasource.hikari.maxLifetime=1800000
spring.datasource.hikari.connectionTestQuery=SELECT 1
spring.datasource.hikari.poolName=CamundaHikariCP

camunda.bpm.database.batchProcessing=true

camunda.bpm.job-execution.wait-time-between-poll=10000
camunda.bpm.process-engine.cache.capacity=100
camunda.bpm.process-engine.cache.time-to-live=3600000

camunda.bpm.history-level=full
camunda.bpm.history.cleanup-batch-size=1000
camunda.bpm.history.cleanup-degree-of-freedom=100
camunda.bpm.history.cleanup-time-period=3600000

Long polling will need to be set by the external tasks you can find more details here:

Due to the version of Spring Framework and Java of our core foundation code in the company, we cannot move it to Camunda 8 at this time.

1 Like