# Heap used always \> 85%

**URL:** https://discuss.elastic.co/t/heap-used-always-85/40363
**Category:** Elasticsearch
**Created:** [January 28, 2016, 1:26pm UTC](https://discuss.elastic.co/t/heap-used-always-85/40363 "2016-01-28T13:26:47Z")
**Posts on this page:** 15
**Page:** 1

<div class="post-metadata">

### Author: ![matiasdecarli](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/matiasdecarli/32/7434_2.png) [@matiasdecarli](https://discuss.elastic.co/u/matiasdecarli)
#### Post date: [January 28, 2016, 1:26pm UTC](https://discuss.elastic.co/t/heap-used-always-85/40363/1 "2016-01-28T13:26:47Z")

</div>

Hi guys, im new to this forum & to Elasticsearch!

I've read a lot, and I been doing some test with a 9-node Elasticsearch running on Docker. Each node in a different VM using an internal network, and I've configured 3 master nodes(no data)/2 client nodes(no data)/4 data nodes.

Right now we have ~130k documents and its working pretty good, but I can see that the Heap Used % is really high. Always arround 85/90%. My data nodes are SSD machines with 56GB of ram (limited to 28GB)

Is this normal? If I enter the detail of the Heap Used I can see that the 4 data nodes are always above 70%

Thanks in advance

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [January 29, 2016, 2:05am UTC](https://discuss.elastic.co/t/heap-used-always-85/40363/2 "2016-01-29T02:05:42Z")

</div>

Welcome!

What sort of data is it? Do you have monitoring - eg Marvel - in place?

---

<div class="post-metadata">

### Author: ![matiasdecarli](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/matiasdecarli/32/7434_2.png) [@matiasdecarli](https://discuss.elastic.co/u/matiasdecarli)
#### Post date: [January 29, 2016, 1:42pm UTC](https://discuss.elastic.co/t/heap-used-always-85/40363/3 "2016-01-29T13:42:44Z")

</div>

Hi Mark! Thanks for your reply!

We are storing objects data types

Regarding monitoring, we are using this ([https://github.com/s12v/newrelic-elasticsearch](https://github.com/s12v/newrelic-elasticsearch)) integration with New Relic. In addition to the monitoring (also on new relic) of every VM. Do you consider necessary to install Marvel?

Thanks in advance

---

<div class="post-metadata">

### Author: ![rusty](https://avatars.discourse-cdn.com/v4/letter/r/f17d59/32.png) [@rusty](https://discuss.elastic.co/u/rusty)
#### Post date: [January 29, 2016, 4:49pm UTC](https://discuss.elastic.co/t/heap-used-always-85/40363/4 "2016-01-29T16:49:57Z")

</div>

Hi! Try to issue `curl -s "localhost:9200/_nodes/stats/?pretty" > nodes_stats.txt` and look through nodes\_stats.txt for values of `memory_size_in_bytes` and `memory_in_bytes`. So you can sum values by node and possible get the main memory eater and also compare to JVM heap usage.

---

<div class="post-metadata">

### Author: ![matiasdecarli](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/matiasdecarli/32/7434_2.png) [@matiasdecarli](https://discuss.elastic.co/u/matiasdecarli)
#### Post date: [January 29, 2016, 7:31pm UTC](https://discuss.elastic.co/t/heap-used-always-85/40363/5 "2016-01-29T19:31:39Z")

</div>

This is what I see everytime

 ![](https://us1.discourse-cdn.com/elastic/original/2X/e/eb28cfb75b96fca698a0f01a4216a1e54aa91193.png)

My elasticsearch.yml

network.publish\_host: [VM ip]  
network.bind\_host: 0.0.0.0

script.engine.groovy.inline.update: on

node.master: [...]  
node.data: [...]  
node.client: [...]

cluster.name: [cluster name]  
node.name: [node name]

indices.cluster.send\_refresh\_mapping: false  
bootstrap.mlockall: true  
action.disable\_delete\_all\_indices: true

gateway.expected\_nodes: 9  
gateway.recover\_after\_time: 5m

indices.fielddata.cache.size: 75%  
indices.breaker.fielddata.limit: 40%

discovery.zen.minimum\_master\_nodes: 2  
discovery.zen.ping.multicast.enabled: false  
discovery.zen.ping.unicast.hosts: [ips]

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [January 29, 2016, 8:58pm UTC](https://discuss.elastic.co/t/heap-used-always-85/40363/6 "2016-01-29T20:58:08Z")

</div>

Marvel provides other info, like query and indexing rates, merging etc etc, all which can have an impact.

---

<div class="post-metadata">

### Author: ![matiasdecarli](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/matiasdecarli/32/7434_2.png) [@matiasdecarli](https://discuss.elastic.co/u/matiasdecarli)
#### Post date: [January 29, 2016, 9:10pm UTC](https://discuss.elastic.co/t/heap-used-always-85/40363/7 "2016-01-29T21:10:23Z")

</div>

Ok, will install Marvel today. Any particular metric that I should look after regarding the +heap used?

Does my config looks good?

---

<div class="post-metadata">

### Author: ![anhlqn](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anhlqn/32/5454_2.png) [@anhlqn](https://discuss.elastic.co/u/anhlqn)
#### Post date: [January 30, 2016, 6:29am UTC](https://discuss.elastic.co/t/heap-used-always-85/40363/8 "2016-01-30T06:29:55Z")

</div>

What is the heap size you set on each node? 28G?

---

<div class="post-metadata">

### Author: ![matiasdecarli](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/matiasdecarli/32/7434_2.png) [@matiasdecarli](https://discuss.elastic.co/u/matiasdecarli)
#### Post date: [January 30, 2016, 6:42am UTC](https://discuss.elastic.co/t/heap-used-always-85/40363/9 "2016-01-30T06:42:23Z")

</div>

Yes. Each data node have 56GB, and they are set to use 28 GB as suggested

---

<div class="post-metadata">

### Author: ![anhlqn](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anhlqn/32/5454_2.png) [@anhlqn](https://discuss.elastic.co/u/anhlqn)
#### Post date: [January 30, 2016, 8:54am UTC](https://discuss.elastic.co/t/heap-used-always-85/40363/10 "2016-01-30T08:54:47Z")

</div>

Hi @matiasdecarli, I'm going to do some performance testing on my ES cluster too, so I'm pretty interested in your case.

Besides Marvel, you can install this ES plugin [http://www.elastichq.org/](http://www.elastichq.org/) or just run it from your local pc and connect to the ES cluster. The Node Diagnostics may provide some helpful information on resource usage. On the ES node that ElasticHQ connects to, you need to add those too lines to elasticsearch.yml and restart ES

> http.cors.enabled: true  
> http.cors.allow-origin: "\*"

For testing purpose, it should be ok to set http.cors.allow-origin to \*. For production, perhaps limit it to localhost with http.cors.allow-origin: /https?://localhost(:[0-9]+)?/  
More info: [HTTP | Elasticsearch Guide [2.1] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/2.1/modules-http.html)

Are you ES nodes running on Linux?  
How big are you 130k documents?

With ElasticHQ, you will see how many GB of heap the ES nodes are using instead of only Heap %

This part

> indices.fielddata.cache.size: 75%  
> indices.breaker.fielddata.limit: 40%

may be the reason why your heap usage is that high.

---

<div class="post-metadata">

### Author: ![matiasdecarli](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/matiasdecarli/32/7434_2.png) [@matiasdecarli](https://discuss.elastic.co/u/matiasdecarli)
#### Post date: [February 1, 2016, 1:04pm UTC](https://discuss.elastic.co/t/heap-used-always-85/40363/11 "2016-02-01T13:04:55Z")

</div>

Hi @anhlqn. Sounds great! Let me set this today and get back to you with some real data!

---

<div class="post-metadata">

### Author: ![anhlqn](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anhlqn/32/5454_2.png) [@anhlqn](https://discuss.elastic.co/u/anhlqn)
#### Post date: [February 1, 2016, 10:14pm UTC](https://discuss.elastic.co/t/heap-used-always-85/40363/12 "2016-02-01T22:14:59Z")

</div>

http.cors.allow-origin: "\*"

Need to double quote the asterisk. Otherwise, you can't start ES

---

<div class="post-metadata">

### Author: ![matiasdecarli](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/matiasdecarli/32/7434_2.png) [@matiasdecarli](https://discuss.elastic.co/u/matiasdecarli)
#### Post date: [February 2, 2016, 5:07pm UTC](https://discuss.elastic.co/t/heap-used-always-85/40363/13 "2016-02-02T17:07:31Z")

</div>

Hi Mark. I have Marvel in place. Any particular metric that I should look after?

---

<div class="post-metadata">

### Author: ![matiasdecarli](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/matiasdecarli/32/7434_2.png) [@matiasdecarli](https://discuss.elastic.co/u/matiasdecarli)
#### Post date: [February 2, 2016, 6:36pm UTC](https://discuss.elastic.co/t/heap-used-always-85/40363/14 "2016-02-02T18:36:48Z")

</div>

I have ElasticHQ & Marvel in place.

---

<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, 11:19pm UTC](https://discuss.elastic.co/t/heap-used-always-85/40363/15 "2017-07-05T23:19:31Z")

</div>


