# High CPU usage when idle

**URL:** <https://discuss.elastic.co/t/high-cpu-usage-when-idle/54963>\
**Category:** Elasticsearch\
**Created:** [July 7, 2016, 3:53pm UTC](https://discuss.elastic.co/t/high-cpu-usage-when-idle/54963 "2016-07-07T15:53:22Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![pip0](https://avatars.discourse-cdn.com/v4/letter/p/7feea3/32.png) [@pip0](https://discuss.elastic.co/u/pip0)\
**Post date:** [July 7, 2016, 3:53pm UTC](https://discuss.elastic.co/t/high-cpu-usage-when-idle/54963/1 "2016-07-07T15:53:22Z")

</div>

Hey I'm currently experiencing a high CPU usage in environment. This is my result of hot threads any idea why the spike is happening ?

[http://pastebin.com/rZrPDyiu](http://pastebin.com/rZrPDyiu)

---

<div class="post-metadata">

**Author:** ![nik9000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nik9000/32/44947_2.png) [@nik9000](https://discuss.elastic.co/u/nik9000)\
**Post date:** [July 7, 2016, 8:14pm UTC](https://discuss.elastic.co/t/high-cpu-usage-when-idle/54963/2 "2016-07-07T20:14:35Z")

</div>

You have a lot of `org.elasticsearch.action.admin.indices.stats.TransportIndicesStatsAction.shardOperation(TransportIndicesStatsAction.java:47)` that comes from the [indices stats](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-stats.html) API. I wouldn't expect more than load average of 1 given what I see on the there. Depending on the version this could be caused by a bug we've since fixed. If you are seeing more than a load average of around 1 then it is something that isn't on the hot threads.

---

<div class="post-metadata">

**Author:** ![nik9000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nik9000/32/44947_2.png) [@nik9000](https://discuss.elastic.co/u/nik9000)\
**Post date:** [July 7, 2016, 8:15pm UTC](https://discuss.elastic.co/t/high-cpu-usage-when-idle/54963/3 "2016-07-07T20:15:43Z")

</div>

By "caused by a bug we've since fixed" I mean that there were versions of Elasticsearch in the 1.x line that were fairly slow at running that request. But it should only come up if you are frequently making that request. Is your monitoring system doing it?

---

<div class="post-metadata">

**Author:** ![pip0](https://avatars.discourse-cdn.com/v4/letter/p/7feea3/32.png) [@pip0](https://discuss.elastic.co/u/pip0)\
**Post date:** [July 7, 2016, 8:40pm UTC](https://discuss.elastic.co/t/high-cpu-usage-when-idle/54963/4 "2016-07-07T20:40:47Z")

</div>

Hey nik9000 thank you for your response. I just checked my version and I'm running the latest 2.3.4 I also just checked to see if I had a tab open with my monitor plugin but I did not .

I run kopf and hq as my monitoring plugins  
I pulled another hot thread dump using kopf  
number of threads: 10

I can paste my node stats if you need to see more information

[http://pastebin.com/aKPFe9bT](http://pastebin.com/aKPFe9bT)

---

<div class="post-metadata">

**Author:** ![nik9000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nik9000/32/44947_2.png) [@nik9000](https://discuss.elastic.co/u/nik9000)\
**Post date:** [July 7, 2016, 8:59pm UTC](https://discuss.elastic.co/t/high-cpu-usage-when-idle/54963/5 "2016-07-07T20:59:25Z")

</div>

That last one just has a single thread doing things. It is busy, but I think it is cut off so I can't tell exactly what. Looks statistics related. What kind of load average are you seeing? How many shards and things?

2.3.4 also has the tasks API so you can look there at running tasks and see if you see any stats requests.

---

<div class="post-metadata">

**Author:** ![pip0](https://avatars.discourse-cdn.com/v4/letter/p/7feea3/32.png) [@pip0](https://discuss.elastic.co/u/pip0)\
**Post date:** [July 8, 2016, 3:54pm UTC](https://discuss.elastic.co/t/high-cpu-usage-when-idle/54963/6 "2016-07-08T15:54:28Z")

</div>

So I think I found the issue. my ES node were running out of heap I allocated another Gig to all the data nodes and the CPU usage dropped by 50%.

Thank you for your help!

---

<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 5, 2017, 10:36pm UTC](https://discuss.elastic.co/t/high-cpu-usage-when-idle/54963/7 "2017-07-05T22:36:59Z")

</div>


