Skip to content

Performance Regression for every CS update from ILM's org.elasticsearch.cluster.metadata.Metadata#isIndexManagedByILM #98992

@original-brownbear

Description

@original-brownbear

Going over the many shards benchmark bootstrapping I noticed it slowed down quite a bit recently.

Turns out a big contributor to this is org.elasticsearch.cluster.metadata.Metadata#isIndexManagedByILM called from
org.elasticsearch.xpack.ilm.IndexLifecycleService#triggerPolicies on every cluster state update and costing O(N) in the number of indices.

image

This could be made more efficient in various ways:

At least we should:

  • remove setting read in the hot loop
  • stop using Metadata.getIndicesLookup, this one is extremely expensive on the applier thread

a first quick fix would be to first check if any datastreams even use DLM and if the answer is no, the whole logic can be skipped. This currently introduces an about 5% overhead into every CS update (relative to stuff like create index and shard allocation in the many shards benchmark) at 25k indices in a cluster and the overhead grows in O(number_of_indices).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions