# Is it normal for my ElasticSearch process to consume 10% of the CPU even when there are no read or write requests?

**URL:** <https://discuss.elastic.co/t/is-it-normal-for-my-elasticsearch-process-to-consume-10-of-the-cpu-even-when-there-are-no-read-or-write-requests/328507>\
**Category:** Elasticsearch\
**Created:** [March 25, 2023, 3:05am UTC](https://discuss.elastic.co/t/is-it-normal-for-my-elasticsearch-process-to-consume-10-of-the-cpu-even-when-there-are-no-read-or-write-requests/328507 "2023-03-25T03:05:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![zzzzer91](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zzzzer91/32/118924_2.png) [@zzzzer91](https://discuss.elastic.co/u/zzzzer91)\
**Post date:** [March 25, 2023, 3:05am UTC](https://discuss.elastic.co/t/is-it-normal-for-my-elasticsearch-process-to-consume-10-of-the-cpu-even-when-there-are-no-read-or-write-requests/328507/1 "2023-03-25T03:05:38Z")

</div>

### Elasticsearch Version

elasticsearch-8.5.3

### Installed Plugins

_No response_

### Java Version

_bundled_

### OS Version

4.19.188-10.el7

### Problem Description

Is it normal for Elasticsearch to consume 10% CPU even without requests after running for a period of time?

### Steps to Reproduce

`top -Hp <es_pid>` :

[![image](https://us1.discourse-cdn.com/elastic/original/3X/e/8/e8c757428e064f5528fc3df4bc774d36baccd772.jpeg)](https://user-images.githubusercontent.com/24646819/212538165-7783ae4e-fee4-43c0-a1a5-c3459afba4ae.png)

Thread 5264 is using approximately 10% of the CPU.

`jstack 5264` :

[![image](https://us1.discourse-cdn.com/elastic/original/3X/9/3/938f6ae1c8d6f760dec2ad3af64bea11835520e0.png)](https://user-images.githubusercontent.com/24646819/212538228-b86dae44-14cb-45c1-8332-b7683d17f781.png)

`strace -p 5264` :  
[![image](https://us1.discourse-cdn.com/elastic/original/3X/9/0/90f7365476931975b81e10921620412ae76e657c.png)](https://user-images.githubusercontent.com/24646819/212538306-df8a476e-132e-4193-a25d-9971782a4cca.png)

The screen is constantly refreshing the content above.

Does anyone know why? Thank you very much.

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [March 25, 2023, 6:22am UTC](https://discuss.elastic.co/t/is-it-normal-for-my-elasticsearch-process-to-consume-10-of-the-cpu-even-when-there-are-no-read-or-write-requests/328507/2 "2023-03-25T06:22:36Z")

</div>

Please run the [hot threads API](https://www.elastic.co/guide/en/elasticsearch/reference/8.6/cluster-nodes-hot-threads.html) when the node is consuming CPU without any requests and share the output. If you have been indexing into the cluster it is possible for merging to occur even during quiet periods and this would show up if you use the API I linked to.

---

<div class="post-metadata">

**Author:** ![zzzzer91](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zzzzer91/32/118924_2.png) [@zzzzer91](https://discuss.elastic.co/u/zzzzer91)\
**Post date:** [March 25, 2023, 6:50am UTC](https://discuss.elastic.co/t/is-it-normal-for-my-elasticsearch-process-to-consume-10-of-the-cpu-even-when-there-are-no-read-or-write-requests/328507/3 "2023-03-25T06:50:33Z")

</div>

I have run the command many times, and in the vast majority of cases, this is the output it produces.

```auto
{ml.machine_memory=8150421504, ml.allocated_processors=2, ml.max_jvm_size=2147483648, ml.allocated_processors_double=2.0, xpack.installed=true}
   Hot threads at 2023-03-25T06:32:22.015Z, interval=500ms, busiestThreads=3, ignoreIdleThreads=true:

```

In rare cases, their output is like this.

```auto
{ml.machine_memory=8150421504, ml.allocated_processors=2, ml.max_jvm_size=2147483648, ml.allocated_processors_double=2.0, xpack.installed=true}
   Hot threads at 2023-03-25T06:46:03.346Z, interval=500ms, busiestThreads=3, ignoreIdleThreads=true:
   
   21.7% [cpu=21.7%, other=0.0%] (108.5ms out of 500ms) cpu usage by thread 'elasticsearch[ucloud-rez4-1][system_read][T#1]'
     2/10 snapshots sharing following 24 elements
       app/org.apache.lucene.core@9.4.2/org.apache.lucene.search.ConjunctionDISI.nextDoc(ConjunctionDISI.java:218)
       app/org.apache.lucene.core@9.4.2/org.apache.lucene.search.Weight$DefaultBulkScorer.scoreRange(Weight.java:284)
       app/org.apache.lucene.core@9.4.2/org.apache.lucene.search.Weight$DefaultBulkScorer.score(Weight.java:254)
       app/org.elasticsearch.server@8.5.3/org.elasticsearch.search.internal.CancellableBulkScorer.score(CancellableBulkScorer.java:45)
       app/org.apache.lucene.core@9.4.2/org.apache.lucene.search.BulkScorer.score(BulkScorer.java:38)
       app/org.elasticsearch.server@8.5.3/org.elasticsearch.search.internal.ContextIndexSearcher.searchLeaf(ContextIndexSearcher.java:196)
       app/org.elasticsearch.server@8.5.3/org.elasticsearch.search.internal.ContextIndexSearcher.search(ContextIndexSearcher.java:170)
       app/org.apache.lucene.core@9.4.2/org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:519)
       app/org.elasticsearch.server@8.5.3/org.elasticsearch.search.query.QueryPhase.searchWithCollector(QueryPhase.java:224)
       app/org.elasticsearch.server@8.5.3/org.elasticsearch.search.query.QueryPhase.executeInternal(QueryPhase.java:179)
       app/org.elasticsearch.server@8.5.3/org.elasticsearch.search.query.QueryPhase.execute(QueryPhase.java:80)
       app/org.elasticsearch.server@8.5.3/org.elasticsearch.search.SearchService.loadOrExecuteQueryPhase(SearchService.java:464)
       app/org.elasticsearch.server@8.5.3/org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:627)
       app/org.elasticsearch.server@8.5.3/org.elasticsearch.search.SearchService.lambda$executeQueryPhase$2(SearchService.java:489)
       app/org.elasticsearch.server@8.5.3/org.elasticsearch.search.SearchService$$Lambda$7249/0x00000008021f9938.get(Unknown Source)
       app/org.elasticsearch.server@8.5.3/org.elasticsearch.search.SearchService$$Lambda$7250/0x00000008021f9b48.get(Unknown Source)
       app/org.elasticsearch.server@8.5.3/org.elasticsearch.action.ActionRunnable$2.accept(ActionRunnable.java:50)
       app/org.elasticsearch.server@8.5.3/org.elasticsearch.action.ActionRunnable$2.accept(ActionRunnable.java:47)
       app/org.elasticsearch.server@8.5.3/org.elasticsearch.action.ActionRunnable$3.doRun(ActionRunnable.java:72)
       app/org.elasticsearch.server@8.5.3/org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:892)
       app/org.elasticsearch.server@8.5.3/org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:26)
       java.base@19.0.1/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
       java.base@19.0.1/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
       java.base@19.0.1/java.lang.Thread.run(Thread.java:1589)
     2/10 snapshots sharing following 23 elements
       app/org.apache.lucene.core@9.4.2/org.apache.lucene.search.ConjunctionDISI.doNext(ConjunctionDISI.java:187)
       app/org.apache.lucene.core@9.4.2/org.apache.lucene.search.ConjunctionDISI.nextDoc(ConjunctionDISI.java:218)
       app/org.apache.lucene.core@9.4.2/org.apache.lucene.search.Weight$DefaultBulkScorer.scoreRange(Weight.java:284)
       app/org.apache.lucene.core@9.4.2/org.apache.lucene.search.Weight$DefaultBulkScorer.score(Weight.java:254)
       app/org.elasticsearch.server@8.5.3/org.elasticsearch.search.internal.CancellableBulkScorer.score(CancellableBulkScorer.java:45)
       app/org.apache.lucene.core@9.4.2/org.apache.lucene.search.BulkScorer.score(BulkScorer.java:38)
       app/org.elasticsearch.server@8.5.3/org.elasticsearch.search.internal.ContextIndexSearcher.searchLeaf(ContextIndexSearcher.java:196)
       app/org.elasticsearch.server@8.5.3/org.elasticsearch.search.internal.ContextIndexSearcher.search(ContextIndexSearcher.java:170)
       app/org.apache.lucene.core@9.4.2/org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:519)
       app/org.elasticsearch.server@8.5.3/org.elasticsearch.search.query.QueryPhase.searchWithCollector(QueryPhase.java:224)
       app/org.elasticsearch.server@8.5.3/org.elasticsearch.search.query.QueryPhase.executeInternal(QueryPhase.java:179)
       app/org.elasticsearch.server@8.5.3/org.elasticsearch.search.query.QueryPhase.execute(QueryPhase.java:80)
       app/org.elasticsearch.server@8.5.3/org.elasticsearch.search.SearchService.lambda$executeFetchPhase$6(SearchService.java:770)
       app/org.elasticsearch.server@8.5.3/org.elasticsearch.search.SearchService$$Lambda$7814/0x00000008022e6888.get(Unknown Source)
       app/org.elasticsearch.server@8.5.3/org.elasticsearch.search.SearchService$$Lambda$7250/0x00000008021f9b48.get(Unknown Source)
       app/org.elasticsearch.server@8.5.3/org.elasticsearch.action.ActionRunnable$2.accept(ActionRunnable.java:50)
       app/org.elasticsearch.server@8.5.3/org.elasticsearch.action.ActionRunnable$2.accept(ActionRunnable.java:47)
       app/org.elasticsearch.server@8.5.3/org.elasticsearch.action.ActionRunnable$3.doRun(ActionRunnable.java:72)
       app/org.elasticsearch.server@8.5.3/org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:892)
       app/org.elasticsearch.server@8.5.3/org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:26)
       java.base@19.0.1/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
       java.base@19.0.1/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
       java.base@19.0.1/java.lang.Thread.run(Thread.java:1589)
     2/10 snapshots sharing following 16 elements
       app/org.elasticsearch.server@8.5.3/org.elasticsearch.search.internal.ContextIndexSearcher.search(ContextIndexSearcher.java:170)
       app/org.apache.lucene.core@9.4.2/org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:519)
       app/org.elasticsearch.server@8.5.3/org.elasticsearch.search.query.QueryPhase.searchWithCollector(QueryPhase.java:224)
       app/org.elasticsearch.server@8.5.3/org.elasticsearch.search.query.QueryPhase.executeInternal(QueryPhase.java:179)
       app/org.elasticsearch.server@8.5.3/org.elasticsearch.search.query.QueryPhase.execute(QueryPhase.java:80)
       app/org.elasticsearch.server@8.5.3/org.elasticsearch.search.SearchService.lambda$executeFetchPhase$6(SearchService.java:770)
       app/org.elasticsearch.server@8.5.3/org.elasticsearch.search.SearchService$$Lambda$7814/0x00000008022e6888.get(Unknown Source)
       app/org.elasticsearch.server@8.5.3/org.elasticsearch.search.SearchService$$Lambda$7250/0x00000008021f9b48.get(Unknown Source)
       app/org.elasticsearch.server@8.5.3/org.elasticsearch.action.ActionRunnable$2.accept(ActionRunnable.java:50)
       app/org.elasticsearch.server@8.5.3/org.elasticsearch.action.ActionRunnable$2.accept(ActionRunnable.java:47)
       app/org.elasticsearch.server@8.5.3/org.elasticsearch.action.ActionRunnable$3.doRun(ActionRunnable.java:72)
       app/org.elasticsearch.server@8.5.3/org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:892)
       app/org.elasticsearch.server@8.5.3/org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:26)
       java.base@19.0.1/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
       java.base@19.0.1/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
       java.base@19.0.1/java.lang.Thread.run(Thread.java:1589)
     4/10 snapshots sharing following 13 elements
       java.base@19.0.1/jdk.internal.misc.Unsafe.park(Native Method)
       java.base@19.0.1/java.util.concurrent.locks.LockSupport.park(LockSupport.java:371)
       java.base@19.0.1/java.util.concurrent.LinkedTransferQueue$Node.block(LinkedTransferQueue.java:470)
       java.base@19.0.1/java.util.concurrent.ForkJoinPool.unmanagedBlock(ForkJoinPool.java:3744)
       java.base@19.0.1/java.util.concurrent.ForkJoinPool.managedBlock(ForkJoinPool.java:3689)
       java.base@19.0.1/java.util.concurrent.LinkedTransferQueue.awaitMatch(LinkedTransferQueue.java:669)
       java.base@19.0.1/java.util.concurrent.LinkedTransferQueue.xfer(LinkedTransferQueue.java:616)
       java.base@19.0.1/java.util.concurrent.LinkedTransferQueue.take(LinkedTransferQueue.java:1286)
       app/org.elasticsearch.server@8.5.3/org.elasticsearch.common.util.concurrent.SizeBlockingQueue.take(SizeBlockingQueue.java:152)
       java.base@19.0.1/java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1070)
       java.base@19.0.1/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
       java.base@19.0.1/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
       java.base@19.0.1/java.lang.Thread.run(Thread.java:1589)

```

This thread is the same as the thread shown as occupying the CPU in top.

---

<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:** [April 22, 2023, 6:50am UTC](https://discuss.elastic.co/t/is-it-normal-for-my-elasticsearch-process-to-consume-10-of-the-cpu-even-when-there-are-no-read-or-write-requests/328507/4 "2023-04-22T06:50:45Z")

</div>

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