Performance of [ACT_RU_METER_LOG]

We recently experience very high load on a sql server hosting the camunda db.

The culprit turned out to be queries of [ACT_RU_METER_LOG] and a quick fix was creating this index:

CREATE NONCLUSTERED INDEX [themissingindex, dbo>]
ON [dbo].[ACT_RU_METER_LOG] ([NAME_],[TIMESTAMP_])
INCLUDE ([VALUE_])

It seems the root cause was > 600000 rows in this table (combined with the missing index); what is the best practice here to avoid that amount of rows and still keep metrics for recent runs?

Only the create scripts for H2 and DB2 database contain this, or at least a very similar, index as well.
For all other databases it’s not created by default.

activiti.db2.create.engine.sql:CREATE INDEX ACT_IDX_METER_LOG ON ACT_RU_METER_LOG(NAME_, TIMESTAMP_);
activiti.h2.create.engine.sql:CREATE INDEX ACT_IDX_METER_LOG ON ACT_RU_METER_LOG(NAME_, TIMESTAMP_);

Why? I don’t know.

1 Like

I found the problem. It turns out adding Prometheus monitoring caused the reporting interval for [ACT_RU_METER_LOG] to change from 15 minutes to 5 seconds. As it writes 10 rows / iteration, that caused extreme growth of data combined with frequent scans of the whole index.

For reference if anyone else sees the problem, the plugin is: