# High CPU after data loaded into memory

**URL:** <https://discuss.elastic.co/t/high-cpu-after-data-loaded-into-memory/237689>\
**Category:** Elasticsearch\
**Created:** [June 18, 2020, 6:10pm UTC](https://discuss.elastic.co/t/high-cpu-after-data-loaded-into-memory/237689 "2020-06-18T18:10:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bhuvaneshdct](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bhuvaneshdct/32/70081_2.png) [@bhuvaneshdct](https://discuss.elastic.co/u/bhuvaneshdct)\
**Post date:** [June 18, 2020, 6:10pm UTC](https://discuss.elastic.co/t/high-cpu-after-data-loaded-into-memory/237689/1 "2020-06-18T18:10:14Z")

</div>

I have an elastic cluster (7.4).

48 core CPU, 380GB memory, SSD Disk, 2 nodes  
Total data: 3TB/per node  
Heal 32GB  
thread\_pool.search.size: 50  
thread\_pool.search.queue\_size: 200  
indices.memory.index\_buffer\_size: 10%

The very first time(Or after restart), I tried to generate some search workloads. For the first few mins the CPU was normal but the IOPS are high. Once the data loaded into the memory then IO bandwidth is very very less, but CPU started consuming 100%.

Hot thread:(truncated)

```auto
       100.6% (503.1ms out of 500ms) cpu usage by thread 'elasticsearch[node-1][search][T#39]'
         9/10 snapshots sharing following 32 elements
           com.amazon.opendistroforelasticsearch.knn.index.v1736.KNNIndex.queryIndex(Native Method)
           com.amazon.opendistroforelasticsearch.knn.index.v1736.KNNIndex.access$000(KNNIndex.java:34)
           com.amazon.opendistroforelasticsearch.knn.index.v1736.KNNIndex$2.run(KNNIndex.java:82)
           com.amazon.opendistroforelasticsearch.knn.index.v1736.KNNIndex$2.run(KNNIndex.java:80)
           java.base@13.0.1/java.security.AccessController.executePrivileged(AccessController.java:753)
           java.base@13.0.1/java.security.AccessController.doPrivileged(AccessController.java:312)
           com.amazon.opendistroforelasticsearch.knn.index.v1736.KNNIndex.queryIndex(KNNIndex.java:79)
           com.amazon.opendistroforelasticsearch.knn.index.KNNWeight.scorer(KNNWeight.java:101)
           app//org.apache.lucene.search.Weight.bulkScorer(Weight.java:181)
           app//org.elasticsearch.search.internal.ContextIndexSearcher$1.bulkScorer(ContextIndexSearcher.java:163)
           app//org.elasticsearch.search.internal.ContextIndexSearcher.searchInternal(ContextIndexSearcher.java:190)
           app//org.elasticsearch.search.internal.ContextIndexSearcher.search(ContextIndexSearcher.java:174)
           app//org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:440)
           app//org.elasticsearch.search.query.QueryPhase.execute(QueryPhase.java:270)

```

all are the same queries, executed via script to perform a small load test.

---

<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:** [July 16, 2020, 6:10pm UTC](https://discuss.elastic.co/t/high-cpu-after-data-loaded-into-memory/237689/2 "2020-07-16T18:10:19Z")

</div>

Closed on July 16, 2020, 6:10pm UTC

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
