# Relation Between Heap Size and Total Data Size

**URL:** <https://discuss.elastic.co/t/relation-between-heap-size-and-total-data-size/16013>\
**Category:** Elasticsearch\
**Created:** [February 25, 2014, 3:25pm UTC](https://discuss.elastic.co/t/relation-between-heap-size-and-total-data-size/16013 "2014-02-25T15:25:50Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![umutcan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/umutcan/32/625_2.png) [@umutcan](https://discuss.elastic.co/u/umutcan)\
**Post date:** [February 25, 2014, 3:25pm UTC](https://discuss.elastic.co/t/relation-between-heap-size-and-total-data-size/16013/1 "2014-02-25T15:25:50Z")

</div>

Hi,

I created a Elasticsearch cluster with 4 instance. Elasticsearch 0.90.10  
is running all of them. Heap size is 6 GB for all the instances, so  
total heap size is 24 GB. I have 5 shard for each index and each shard  
has 1 replica. A new index is created for every day, so all indices have  
nearly same size.

When total data size reaches around 100 GB (replicas are included), my  
cluster begins to fail to allocate some of the shards (status yellow).  
After I delete some old indices and restart all the nodes, everything is  
fine (status is green). If I do not delete some data, status eventually  
turns red.

So, I am wondering that is there any relationship between heap size and  
total data size? Is there any formula to determine heap size based on  
data size?

Thanks,  
Umutcan

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/530CB5FE.80203%40gamegos.com](https://groups.google.com/d/msgid/elasticsearch/530CB5FE.80203%40gamegos.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Randall\_McRee](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/randall_mcree/32/47177_2.png) [@Randall\_McRee](https://discuss.elastic.co/u/Randall_McRee)\
**Post date:** [February 25, 2014, 3:29pm UTC](https://discuss.elastic.co/t/relation-between-heap-size-and-total-data-size/16013/2 "2014-02-25T15:29:19Z")

</div>

Probably low on disc on at least one machine. Monitor disc usage. Also look in the logs and find out what error you are getting. Report back.

Sent from my iPhone

> On Feb 25, 2014, at 7:25 AM, Umutcan [umutcan@gamegos.com](mailto:umutcan@gamegos.com) wrote:
> 
> Hi,
> 
> I created a Elasticsearch cluster with 4 instance. Elasticsearch 0.90.10 is running all of them. Heap size is 6 GB for all the instances, so total heap size is 24 GB. I have 5 shard for each index and each shard has 1 replica. A new index is created for every day, so all indices have nearly same size.
> 
> When total data size reaches around 100 GB (replicas are included), my cluster begins to fail to allocate some of the shards (status yellow). After I delete some old indices and restart all the nodes, everything is fine (status is green). If I do not delete some data, status eventually turns red.
> 
> So, I am wondering that is there any relationship between heap size and total data size? Is there any formula to determine heap size based on data size?
> 
> Thanks,  
> Umutcan
> 
> --  
> 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).  
> To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/530CB5FE.80203%40gamegos.com](https://groups.google.com/d/msgid/elasticsearch/530CB5FE.80203%40gamegos.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/A319EF53-D5C4-485C-B320-574C677D8314%40gmail.com](https://groups.google.com/d/msgid/elasticsearch/A319EF53-D5C4-485C-B320-574C677D8314%40gmail.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![umutcan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/umutcan/32/625_2.png) [@umutcan](https://discuss.elastic.co/u/umutcan)\
**Post date:** [February 26, 2014, 7:06am UTC](https://discuss.elastic.co/t/relation-between-heap-size-and-total-data-size/16013/3 "2014-02-26T07:06:46Z")

</div>

There is enough space on every machine. I looked in the logs and find  
out that "org.apache.lucene.store.LockObtainFailedException: Lock obtain  
timed out:  
NativeFSLock@/ebs/elasticsearch/elasticsearch-0.90.10/data/elasticsearch/nodes/0/indices/logstash-2014.02.26/0/index/write.lock"  
is what causes the shard fails to start.

On 02/25/2014 05:29 PM, Randy wrote:

> Probably low on disc on at least one machine. Monitor disc usage. Also look in the logs and find out what error you are getting. Report back.
> 
> Sent from my iPhone
> 
> > On Feb 25, 2014, at 7:25 AM, Umutcan [umutcan@gamegos.com](mailto:umutcan@gamegos.com) wrote:
> > 
> > Hi,
> > 
> > I created a Elasticsearch cluster with 4 instance. Elasticsearch 0.90.10 is running all of them. Heap size is 6 GB for all the instances, so total heap size is 24 GB. I have 5 shard for each index and each shard has 1 replica. A new index is created for every day, so all indices have nearly same size.
> > 
> > When total data size reaches around 100 GB (replicas are included), my cluster begins to fail to allocate some of the shards (status yellow). After I delete some old indices and restart all the nodes, everything is fine (status is green). If I do not delete some data, status eventually turns red.
> > 
> > So, I am wondering that is there any relationship between heap size and total data size? Is there any formula to determine heap size based on data size?
> > 
> > Thanks,  
> > Umutcan
> > 
> > --  
> > 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).  
> > To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/530CB5FE.80203%40gamegos.com](https://groups.google.com/d/msgid/elasticsearch/530CB5FE.80203%40gamegos.com).  
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/530D9286.60300%40gamegos.com](https://groups.google.com/d/msgid/elasticsearch/530D9286.60300%40gamegos.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Dan\_Fairs](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dan_fairs/32/1205_2.png) [@Dan\_Fairs](https://discuss.elastic.co/u/Dan_Fairs)\
**Post date:** [February 26, 2014, 11:32am UTC](https://discuss.elastic.co/t/relation-between-heap-size-and-total-data-size/16013/4 "2014-02-26T11:32:51Z")

</div>

> So, I am wondering that is there any relationship between heap size and total data size? Is there any formula to determine heap size based on data size?

You might want to check that you're not running out of file handles:

[Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/tutorials/too-many-open-files/)

Cheers,  
Dan

--  
Dan Fairs | [dan.fairs@gmail.com](mailto:dan.fairs@gmail.com) | @danfairs | [secondsync.com](http://secondsync.com)

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/FDC26956-0E46-4E2B-9A0D-1F899DDFD015%40gmail.com](https://groups.google.com/d/msgid/elasticsearch/FDC26956-0E46-4E2B-9A0D-1F899DDFD015%40gmail.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![umutcan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/umutcan/32/625_2.png) [@umutcan](https://discuss.elastic.co/u/umutcan)\
**Post date:** [February 27, 2014, 6:49am UTC](https://discuss.elastic.co/t/relation-between-heap-size-and-total-data-size/16013/5 "2014-02-27T06:49:19Z")

</div>

> > So, I am wondering that is there any relationship between heap size and total data size? Is there any formula to determine heap size based on data size?
> 
> You might want to check that you're not running out of file handles:
> 
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/tutorials/too-many-open-files/)

Thanks Dan. This article solves my problem.

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/530EDFEF.1060505%40gamegos.com](https://groups.google.com/d/msgid/elasticsearch/530EDFEF.1060505%40gamegos.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, 1:46am UTC](https://discuss.elastic.co/t/relation-between-heap-size-and-total-data-size/16013/6 "2017-07-06T01:46:56Z")

</div>


