opensearch-project / opensearch-project/OpenSearch

[Enhancement] Cluster health API uses 36% of memory allocations during index creation

Open
#11,684 1 comment 0 reactions 1 assignee View on GitHub

@SwethaGuptha is already working on this.

Since Sep 10, 2024.

bug Cluster Manager
Dominant language
Java
Stars
13.7k
Forks
3k
Avg merge
2d 23h
Merged PRs (30d)
108

Description

Describe the bug

While using a large cluster with more than 300K shards, if we start creating index, it takes more than 15 seconds. To optimize this flow, we should use less resource in terms of CPU and JVM.

_cluster/health API flow takes more than 36% of memory allocations (see attached image of async-profiler for reference). 20% of it is taken in calculating the health and 16% is taken in just constructing the response.

Related component

Cluster Manager

To Reproduce
  1. Create a 300 node cluster with 300K shards.
  2. Start new index creation.
  3. Take async profiler alloc profile on active cluster manager node.
  4. See that cluster/health flow takes more than 36% of memory allocations
Expected behavior

Ideally it should be optimized to use lesser resources. If possible we can pre-compute health for a particular cluster state version, so whenever it's needed, we don't do whole re-computation again if version is same.

Additional Details

Screenshots
github-upload-cluster-health-takes-36%-allocations-during-index-creation-1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.