Hi,
Using Camunda 7 community edition (Docker image camunda-bpm-platform:tomcat-7.20.0) with Postgresql as database.
In a setup where bpmn deployment is done only once and utilizing same model for every runs (process instance start’s), expecting deployment cache should be utilizing it fully to avoid SQL calls as much as this engine could.
When enabled engine.persistence debug level, noticed that below query getting logged every time in instance execution.
Select * from ACT_RE_PROCDEF where ID = $1
Does it mean deployment cache is not getting fully utilized in entire instance execution?
Above query is just one example… It might be applicable to other “select” queries in Camunda process instance run also.
More details… Here are the example logs:
- At deployment time, it shows :
13-May-2024 07:39:22.936 FINE [http-nio-9016-exec-19] org.camunda.commons.logging.BaseLogger.logDebug ENGINE-03006 Cache state after flush: [
PERSISTENT ResourceEntity[ea844fe9-10fb-11ef-a1b0-a65565181738]
PERSISTENT ProcessDefinitionEntity[default_tasks1:1:ea8699da-10fb-11ef-a1b0-a65565181738]
PERSISTENT DeploymentEntity[ea82c948-10fb-11ef-a1b0-a65565181738]
]
13-May-2024 07:39:22.937 FINE [http-nio-9016-exec-19] org.camunda.commons.logging.BaseLogger.logDebug ENGINE-03008 Flush Summary: [
INSERT DeploymentEntity[ea82c948-10fb-11ef-a1b0-a65565181738]
INSERT ResourceEntity[ea844fe9-10fb-11ef-a1b0-a65565181738]
INSERT ProcessDefinitionEntity[default_tasks1:1:ea8699da-10fb-11ef-a1b0-a65565181738]
]
- First run, cache state shows:
13-May-2024 07:41:19.957 FINE [http-nio-9016-exec-3] org.apache.ibatis.logging.jdbc.BaseJdbcLogger.debug ==> Preparing: select * from ACT_RE_PROCDEF where ID_ = ?
13-May-2024 07:41:19.957 FINE [http-nio-9016-exec-3] org.apache.ibatis.logging.jdbc.BaseJdbcLogger.debug ==> Parameters: default_tasks1:1:ea8699da-10fb-11ef-a1b0-a65565181738(String)
13-May-2024 07:41:20.472 FINE [http-nio-9016-exec-3] org.camunda.commons.logging.BaseLogger.logDebug ENGINE-03006 Cache state after flush: [
PERSISTENT ProcessDefinitionEntity[default_tasks1:1:ea8699da-10fb-11ef-a1b0-a65565181738]
]
- Second run cache state shows:
13-May-2024 07:42:12.103 FINE [http-nio-9016-exec-8] org.apache.ibatis.logging.jdbc.BaseJdbcLogger.debug ==> Preparing: select * from ACT_RE_PROCDEF where ID_ = ?
13-May-2024 07:42:12.103 FINE [http-nio-9016-exec-8] org.apache.ibatis.logging.jdbc.BaseJdbcLogger.debug ==> Parameters: default_tasks1:1:ea8699da-10fb-11ef-a1b0-a65565181738(String)
13-May-2024 07:42:12.115 FINE [http-nio-9016-exec-8] org.camunda.commons.logging.BaseLogger.logDebug ENGINE-03006 Cache state after flush: [
PERSISTENT ProcessDefinitionEntity[default_tasks1:1:ea8699da-10fb-11ef-a1b0-a65565181738]
]
Not sure if understanding is correct but if Cache is already having entry for ProcessDefinitionEntity, should not it be utilizing in second run and hence skip
select * from ACT_RE_PROCDEF
call for every instance execution ?
How does the deployment cache work and when will it get flushed ?
Is it the case that it can be flushed in every instance execution based on some condition?
Can the scope to retain cache be increased based on some configuration/usage ?
Want to leverage deployment cache fully to reduce calls to postgres db calls wherever possible.