# Memory allocation to elasticsearch component for a cluster setup with n nodes

**URL:** <https://discuss.elastic.co/t/memory-allocation-to-elasticsearch-component-for-a-cluster-setup-with-n-nodes/96908>\
**Category:** Elasticsearch\
**Created:** [August 14, 2017, 6:10am UTC](https://discuss.elastic.co/t/memory-allocation-to-elasticsearch-component-for-a-cluster-setup-with-n-nodes/96908 "2017-08-14T06:10:57Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tushar\_Sharma1](https://avatars.discourse-cdn.com/v4/letter/t/c4cdca/32.png) [@Tushar\_Sharma1](https://discuss.elastic.co/u/Tushar_Sharma1)\
**Post date:** [August 14, 2017, 6:10am UTC](https://discuss.elastic.co/t/memory-allocation-to-elasticsearch-component-for-a-cluster-setup-with-n-nodes/96908/1 "2017-08-14T06:10:58Z")

</div>

Hi,

I am trying to setup cluster but i'm confused that whether index size,shard size depend upon "Ram" or "disk" size.  
Do I need to divide disk memory or RAM of a cluster between shards.

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [August 14, 2017, 7:32am UTC](https://discuss.elastic.co/t/memory-allocation-to-elasticsearch-component-for-a-cluster-setup-with-n-nodes/96908/2 "2017-08-14T07:32:36Z")

</div>

I do not fully understand the question. First and foremost you need the space on disk to index your data, as it is always written. However every shard that lives in your cluster also requires some memory, so they are not 'free'.

The underlying question is more about sizing I suppose - and that is a complex question because of the generic nature of Elasticsearch. You need to take ingestion rates, query rates, query complexity (search vs. aggregations vs. highlighting), size of a single document, mapping configuration and more factors into account, so there is no simple formula.

---

<div class="post-metadata">

**Author:** ![Tushar\_Sharma1](https://avatars.discourse-cdn.com/v4/letter/t/c4cdca/32.png) [@Tushar\_Sharma1](https://discuss.elastic.co/u/Tushar_Sharma1)\
**Post date:** [August 14, 2017, 9:48am UTC](https://discuss.elastic.co/t/memory-allocation-to-elasticsearch-component-for-a-cluster-setup-with-n-nodes/96908/3 "2017-08-14T09:48:04Z")

</div>

Thanks for Reply.I'm actually not clear that how shard size is related with RAM.  
For e.g. I have 3 nodes with 1TB disk space +16GB RAM each ,So If I have to store 1.5TB document in one index then .

1)what should be maximum shard size and Do I have to take RAM also in consideration for shard size allocation?  
2)What should be Index Size?

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [August 14, 2017, 1:48pm UTC](https://discuss.elastic.co/t/memory-allocation-to-elasticsearch-component-for-a-cluster-setup-with-n-nodes/96908/4 "2017-08-14T13:48:40Z")

</div>

Take your time and read the whole [Designing for scale](https://www.elastic.co/guide/en/elasticsearch/guide/current/scale.html) chapter in the definitive guide. This is a complex topic and cannot be answered with a few sentences.

---

<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:** [September 11, 2017, 1:49pm UTC](https://discuss.elastic.co/t/memory-allocation-to-elasticsearch-component-for-a-cluster-setup-with-n-nodes/96908/5 "2017-09-11T13:49:23Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
