# 100% CPU-Usage on data nodes

**URL:** <https://discuss.elastic.co/t/100-cpu-usage-on-data-nodes/226079>\
**Category:** Elastic Cloud on Kubernetes (ECK)\
**Created:** [April 1, 2020, 3:30pm UTC](https://discuss.elastic.co/t/100-cpu-usage-on-data-nodes/226079 "2020-04-01T15:30:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mugen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mugen/32/16454_2.png) [@Mugen](https://discuss.elastic.co/u/Mugen)\
**Post date:** [April 1, 2020, 3:30pm UTC](https://discuss.elastic.co/t/100-cpu-usage-on-data-nodes/226079/1 "2020-04-01T15:30:57Z")

</div>

Hi Guys. We currently run ECK with 3 master- and 4 data nodes.  
Our data nodes jump up to 100% cpu with some querys (its an easy querie for one keyword field)  
We are using ECK 1.0.1 and Elasticsearch 7.6  
The configuration is as follows :

```auto
resources data nodes:

    esJavaOpts: "-Xms8000m -Xmx8000m -XX:MaxMetaspaceSize=1G"
    resources:
      requests:
        cpu: 3000m
        memory: 16000Mi
      limits:
        cpu: 3000m
        memory: 16000Mi
    storage: 1000Gi

```

Index Info :  
(One Index for each day but we mostly query 1 day)

```auto
Primaries: 4
Docs Count: 155582677
Storage Size: 221.2gb
Replicas: 2

```

Used Query:

```auto
{
  "query": {
    "match_phrase": {
      "our.searched.field": "value"
    }
  }
}

```

The data node does not log any error. But the monitoring clearly shows the cpu rise to 100% for a certain time.

Should we change the shards of our indexes or give more cpu or something else?

---

<div class="post-metadata">

**Author:** ![sebgl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sebgl/32/48702_2.png) [@sebgl](https://discuss.elastic.co/u/sebgl)\
**Post date:** [April 2, 2020, 1:23pm UTC](https://discuss.elastic.co/t/100-cpu-usage-on-data-nodes/226079/2 "2020-04-02T13:23:36Z")

</div>

I don't know if this could be related to the query performance, probably worth asking in the Elasticsearch section of this forum.

As far as K8s is concerned, there is a known performance issue related to cpu limits. I [documented my findings](https://github.com/elastic/cloud-on-k8s/issues/2402#issuecomment-576717651) a little while ago.

In short, you could either:

- use a recent Kernel version with the fix included
- remove the cpu limits (keep only cpu requests)
- tweak CFS quotas settings
- tweak

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [November 4, 2022, 7:51am UTC](https://discuss.elastic.co/t/100-cpu-usage-on-data-nodes/226079/3 "2022-11-04T07:51:49Z")

</div>


