# ElasticSeach full CPU usage

**URL:** <https://discuss.elastic.co/t/elasticseach-full-cpu-usage/13732>\
**Category:** Elasticsearch\
**Created:** [September 24, 2013, 10:19am UTC](https://discuss.elastic.co/t/elasticseach-full-cpu-usage/13732 "2013-09-24T10:19:37Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Span\_Marius](https://avatars.discourse-cdn.com/v4/letter/s/258eb7/32.png) [@Span\_Marius](https://discuss.elastic.co/u/Span_Marius)\
**Post date:** [September 24, 2013, 10:19am UTC](https://discuss.elastic.co/t/elasticseach-full-cpu-usage/13732/1 "2013-09-24T10:19:37Z")

</div>

Hello,

I'm currently using ElasticSearch 0.19.11 deployed into CentOS 5.7 (kernel  
2.6.18-274.18.1.el5xen) boxes having 4GB or RAM/4 cores. The environment  
contains 2 such boxes and ElasticSearch is not clustered (effectively the  
two being independent). From time to time (once every approximately 3 or 4  
days) one of the machines (apparently in a random order) heavily degrades  
it's performance up to full CPU consumption.

The Java process running the ElasticSeach is configured with: "-Xms1g  
-Xmx1g -Xss256k -XX:+UseParNewGC -XX:+UseConcMarkSweepGC  
-XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly"  
parameters.\* \*Each instance has a single index and contains ~1K documents.

Attached are some facts observed while experiencing the high CPU  
consumption: jstat.txt, jstack.txt, top.txt, hotthreads.txt and the  
elasticsearch.yml config we are using.

Can anyone help?

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Span\_Marius](https://avatars.discourse-cdn.com/v4/letter/s/258eb7/32.png) [@Span\_Marius](https://discuss.elastic.co/u/Span_Marius)\
**Post date:** [September 25, 2013, 9:42am UTC](https://discuss.elastic.co/t/elasticseach-full-cpu-usage/13732/2 "2013-09-25T09:42:54Z")

</div>

The PID of the ES process was 32024.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [September 25, 2013, 7:41pm UTC](https://discuss.elastic.co/t/elasticseach-full-cpu-usage/13732/3 "2013-09-25T19:41:09Z")

</div>

What JVM version do you use?

Jörg

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Span\_Marius](https://avatars.discourse-cdn.com/v4/letter/s/258eb7/32.png) [@Span\_Marius](https://discuss.elastic.co/u/Span_Marius)\
**Post date:** [September 26, 2013, 7:04am UTC](https://discuss.elastic.co/t/elasticseach-full-cpu-usage/13732/4 "2013-09-26T07:04:23Z")

</div>

Hello Jörg,

Thanks for your reply, here is the version of the Java currently installed  
("java -version"):

_java version "1.6.0\_26"_

_Java(TM) SE Runtime Environment (build 1.6.0\_26-b03)_  
_Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02, mixed mode)_

Do you have any suspects?

Regards,  
Marius Span.

On Tuesday, September 24, 2013 1:19:37 PM UTC+3, Span Marius wrote:

> Hello,
> 
> I'm currently using Elasticsearch 0.19.11 deployed into CentOS 5.7 (kernel  
> 2.6.18-274.18.1.el5xen) boxes having 4GB or RAM/4 cores. The environment  
> contains 2 such boxes and Elasticsearch is not clustered (effectively the  
> two being independent). From time to time (once every approximately 3 or 4  
> days) one of the machines (apparently in a random order) heavily degrades  
> it's performance up to full CPU consumption.
> 
> The Java process running the ElasticSeach is configured with: "-Xms1g  
> -Xmx1g -Xss256k -XX:+UseParNewGC -XX:+UseConcMarkSweepGC  
> -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly"  
> parameters.\* \*Each instance has a single index and contains ~1K documents.
> 
> Attached are some facts observed while experiencing the high CPU  
> consumption: jstat.txt, jstack.txt, top.txt, hotthreads.txt and the  
> elasticsearch.yml config we are using.
> 
> Can anyone help?

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [September 26, 2013, 7:19am UTC](https://discuss.elastic.co/t/elasticseach-full-cpu-usage/13732/5 "2013-09-26T07:19:11Z")

</div>

I can't see what is happening exactly, but it looks like you ran into lock  
contention at random which is not related to ES or Lucene but to the  
underlying JVM. Can the issue be reproduced?

You should try if increasing the heap memory works because Java 6 has some  
memory related issues.

Java 6u26 is quite old. It should be updated to the latest Java 7.

Jörg

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Span\_Marius](https://avatars.discourse-cdn.com/v4/letter/s/258eb7/32.png) [@Span\_Marius](https://discuss.elastic.co/u/Span_Marius)\
**Post date:** [September 26, 2013, 7:39am UTC](https://discuss.elastic.co/t/elasticseach-full-cpu-usage/13732/6 "2013-09-26T07:39:14Z")

</div>

Jörg,

Unfortunately I did not manage to create a deterministic reproduction path.  
Currently this is happening once every 3 to 5 days on random boxes.

Thanks for your suggestion, we'll do this together with an ES upgrade as  
soon as possible.  
Until than, do you see any other thing being suspicious?

Marius.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [September 26, 2013, 9:36am UTC](https://discuss.elastic.co/t/elasticseach-full-cpu-usage/13732/7 "2013-09-26T09:36:49Z")

</div>

Except that 0.19.11 is the version I also want to upgrade asap to 0.90+, I  
can't see any peculiarities. 0.19 is a bit memory hungry when it uses  
caches/facets.

Jörg

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:14am UTC](https://discuss.elastic.co/t/elasticseach-full-cpu-usage/13732/8 "2017-07-06T02:14:37Z")

</div>


