# Shards and replicas allocation in elasticsearch

**URL:** <https://discuss.elastic.co/t/shards-and-replicas-allocation-in-elasticsearch/156770>\
**Category:** Elasticsearch\
**Created:** [November 15, 2018, 2:51am UTC](https://discuss.elastic.co/t/shards-and-replicas-allocation-in-elasticsearch/156770 "2018-11-15T02:51:54Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![iamlearner123](https://avatars.discourse-cdn.com/v4/letter/i/bcef8e/32.png) [@iamlearner123](https://discuss.elastic.co/u/iamlearner123)\
**Post date:** [November 15, 2018, 2:51am UTC](https://discuss.elastic.co/t/shards-and-replicas-allocation-in-elasticsearch/156770/1 "2018-11-15T02:51:54Z")

</div>

Hi,  
i am new to Elasticsearch and still learning it . can i please how to calculate the number of shards and replicas required for an index ? i now that number factors should be considered but i am kind of confused after reading articles on the internet because some say to use 40% of data node capacity while others use the JVM heap size for calculation shards. For example, i have 9 node cluster with 10GB storage per node and i want index 50 GB of data and JVM size is 32GB. how many shards and replicas do i need ? what is the best practice ?Any detailed explanation would be really helpful .

Thank you

---

<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:** [November 15, 2018, 4:02am UTC](https://discuss.elastic.co/t/shards-and-replicas-allocation-in-elasticsearch/156770/2 "2018-11-15T04:02:49Z")

</div>

> [@iamlearner123](#):
>
> with 10GB storage per node

10GB, are you sure that is correct?

---

<div class="post-metadata">

**Author:** ![iamlearner123](https://avatars.discourse-cdn.com/v4/letter/i/bcef8e/32.png) [@iamlearner123](https://discuss.elastic.co/u/iamlearner123)\
**Post date:** [November 15, 2018, 6:02am UTC](https://discuss.elastic.co/t/shards-and-replicas-allocation-in-elasticsearch/156770/3 "2018-11-15T06:02:29Z")

</div>

yes.. each node has 10GB storage.

---

<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:** [November 15, 2018, 7:28am UTC](https://discuss.elastic.co/t/shards-and-replicas-allocation-in-elasticsearch/156770/4 "2018-11-15T07:28:56Z")

</div>

That's a huge heap size for a small amount of data. It's not really efficient.

---

<div class="post-metadata">

**Author:** ![iamlearner123](https://avatars.discourse-cdn.com/v4/letter/i/bcef8e/32.png) [@iamlearner123](https://discuss.elastic.co/u/iamlearner123)\
**Post date:** [November 15, 2018, 3:28pm UTC](https://discuss.elastic.co/t/shards-and-replicas-allocation-in-elasticsearch/156770/5 "2018-11-15T15:28:05Z")

</div>

Thank you for the reply. So, we assign the shards based on the heap size on the node ? What am i trying to understand is that on what factors does assignment of shards and replicas depends?

---

<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:** [November 15, 2018, 11:50pm UTC](https://discuss.elastic.co/t/shards-and-replicas-allocation-in-elasticsearch/156770/6 "2018-11-15T23:50:11Z")

</div>

Shard count per node, and disk space use.

---

<div class="post-metadata">

**Author:** ![iamlearner123](https://avatars.discourse-cdn.com/v4/letter/i/bcef8e/32.png) [@iamlearner123](https://discuss.elastic.co/u/iamlearner123)\
**Post date:** [November 19, 2018, 11:37pm UTC](https://discuss.elastic.co/t/shards-and-replicas-allocation-in-elasticsearch/156770/7 "2018-11-19T23:37:04Z")

</div>

But in my case i am having a data set of 50GB. Can i please know how many shards to allocate per node and why ?

Thank you

---

<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:** [December 17, 2018, 11:37pm UTC](https://discuss.elastic.co/t/shards-and-replicas-allocation-in-elasticsearch/156770/8 "2018-12-17T23:37:07Z")

</div>

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