# Elasticsearch consumes all CPU

**URL:** <https://discuss.elastic.co/t/elasticsearch-consumes-all-cpu/9143>\
**Category:** Elasticsearch\
**Created:** [September 25, 2012, 9:12pm UTC](https://discuss.elastic.co/t/elasticsearch-consumes-all-cpu/9143 "2012-09-25T21:12:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Crwe](https://avatars.discourse-cdn.com/v4/letter/c/898d66/32.png) [@Crwe](https://discuss.elastic.co/u/Crwe)\
**Post date:** [September 25, 2012, 9:12pm UTC](https://discuss.elastic.co/t/elasticsearch-consumes-all-cpu/9143/1 "2012-09-25T21:12:07Z")

</div>

Hello all,

ES became unresponsive. I checked the log and it's full of lines like:

[2012-09-25 22:52:02,433][WARN][monitor.jvm]  
[Destroyer] [gc][ParNew][133651][2563] duration [4.3s], collections  
[1]/[4.4s], total [4.3s]/[40.4m], memory [6.6gb]-\>[6.7gb]/[8.9gb],  
all\_pools {[Code Cache] [8.3mb]-\>[8.3mb]/[48mb]}{[Par Eden Space]  
[1.4mb]-\>[3.5mb]/[66.5mb]}{[Par Survivor Space] [8.3mb]-\>[8.3mb]/  
[8.3mb]}{[CMS Old Gen] [6.6gb]-\>[6.7gb]/[8.9gb]}{[CMS Perm Gen] [38mb]-

> [38mb]/[82mb]}

According to the log, there is still plenty of RAM left, but CPU is  
stuck at full 400% (4 cores) for the java process. Any idea what's  
going on?

This is a 13GB VM, with 9GB dedicated to JVM (Sun 20.1-b02) with  
mlockall, 4 cores, no load.

I tried inspecting with bigdesk, but bigdesk won't even load up, as  
all cores are so busy... Restarting the machine doesn't help either --  
ES starts normally, but the first query that comes in spins up CPU to  
400% again. I am a bit desperate about how to debug this.

--

---

<div class="post-metadata">

**Author:** ![otisg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/otisg/32/492_2.png) [@otisg](https://discuss.elastic.co/u/otisg)\
**Post date:** [September 26, 2012, 3:26am UTC](https://discuss.elastic.co/t/elasticsearch-consumes-all-cpu/9143/2 "2012-09-26T03:26:12Z")

</div>

Hello,

Use SPM for Elasticsearch (see sig), it will help you out.  
To have a closer look at what the JVM is going you can also use jstat  
-gcutil PID 2000 100

## Otis

Search Analytics - [Cloud Monitoring Tools & Services | Sematext](http://sematext.com/search-analytics/index.html)  
Performance Monitoring - [Sematext Monitoring | Infrastructure Monitoring Service](http://sematext.com/spm/index.html)

On Tuesday, September 25, 2012 5:12:12 PM UTC-4, Crwe wrote:

> Hello all,
> 
> ES became unresponsive. I checked the log and it's full of lines like:
> 
> [2012-09-25 22:52:02,433][WARN][monitor.jvm]  
> [Destroyer] [gc][ParNew][133651][2563] duration [4.3s], collections  
> [1]/[4.4s], total [4.3s]/[40.4m], memory [6.6gb]-\>[6.7gb]/[8.9gb],  
> all\_pools {[Code Cache] [8.3mb]-\>[8.3mb]/[48mb]}{[Par Eden Space]  
> [1.4mb]-\>[3.5mb]/[66.5mb]}{[Par Survivor Space] [8.3mb]-\>[8.3mb]/  
> [8.3mb]}{[CMS Old Gen] [6.6gb]-\>[6.7gb]/[8.9gb]}{[CMS Perm Gen] [38mb]-
> 
> > [38mb]/[82mb]}
> 
> According to the log, there is still plenty of RAM left, but CPU is  
> stuck at full 400% (4 cores) for the java process. Any idea what's  
> going on?
> 
> This is a 13GB VM, with 9GB dedicated to JVM (Sun 20.1-b02) with  
> mlockall, 4 cores, no load.
> 
> I tried inspecting with bigdesk, but bigdesk won't even load up, as  
> all cores are so busy... Restarting the machine doesn't help either --  
> ES starts normally, but the first query that comes in spins up CPU to  
> 400% again. I am a bit desperate about how to debug this.

--

---

<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 6, 2017, 3:11am UTC](https://discuss.elastic.co/t/elasticsearch-consumes-all-cpu/9143/3 "2017-07-06T03:11:27Z")

</div>


