We encountered some performance issues when running > 15.000 process instances (Oracle 11g, MySQL 5.1).
Settings:
History Level: activity
Camunda BPM version: 7.0.0-alpha1
Processing: max. 25 process instance in parallel
After doing some DB tracing on Oracle11g we found out, that the issues are related to exactly one SQL statement:
select * from ( select a.*, ROWNUM rnum from (
select RES.*
from ACT_HI_ACTINST RES
WHERE RES.EXECUTION_ID_ = :?
and RES.ACT_ID_ = :?
and RES.END_TIME_ is null
order by RES.ID_ asc
) a where ROWNUM = :? ) where rnum >= :?
We created an additional index (quite statement-specific) and with the new index the performance is back to a normal/very good value (statement execution time decreased from >500ms to <15ms, number of rows in ACT_HI_ACTINST: 680K, statement costs remain the same)
Index:
CREATE INDEX ACT_IDX_HI_ACT_INST_IMPR ON ACT_HI_ACTINST (EXECUTION_ID_, ACT_ID_, END_TIME_, ID_);
Is there a way that the additional index is added to the DB-setup scripts, or can we somehow intercept the DB schema updates on engine startup?
Thanks & Cheers
Michael
I have added an issue to our backlog for 7.0.0 Final Version:
https://app.camunda.com/jira/browse/CAM-683
You can register for our Jira if you want to add comments.
Thank you for your feedback!
Robert
Hi Thomas.
If you do the signal in the background the following SQL is executed – which is pretty different to what you write:
<select id="selectExecution" parameterType="string" resultMap="executionResultMap">
select * from ${prefix}ACT_RU_EXECUTION where ID_ = #{id}
</select>
So that cannot cause this query.
How do you know which executionId to trigger?
Do you have a limited test case where the query is issued? Then we could have a deeper look why we get this SQL?
What puzzles me is that when I did a quick search through the code I only found the SQL snippet you mention when issuing queries via the Query API. Strange!
Cheers
Bernd
I did some quick digging into the engine. The query described is issued in the ActivityInstanceEndHandler in method findActivityInstance(ExecutionEntity execution) => core part of the engine. Imo we should add it as default.
Thanks Christian for finding this usage - somehow slipped through my quick search. Then this is indeed an internal issue and we will add that index.
Thanks Thomas for reporting this!
Cheers
Bernd
Evangelist & Consultant
www.camunda.org/community/team.html
Von: camunda-...@googlegroups.com [mailto:camunda-...@googlegroups.com] Im Auftrag von Christian Lipphardt
Gesendet: Dienstag, 7. Mai 2013 13:36
An: camunda-...@googlegroups.com
Cc: Thomas.Andr...@sonydadc.com; peter.h...@sonydadc.com; m.radli...@gmail.com
Betreff: Re: Performance Improvements for big amount of workflow instances
I did some quick digging into the engine. The query described is issued in the ActivityInstanceEndHandler in method findActivityInstance(ExecutionEntity execution) => core part of the engine. Imo we should add it as default.
--