# How to chose the number of shards and replica

**URL:** <https://discuss.elastic.co/t/how-to-chose-the-number-of-shards-and-replica/249321>\
**Category:** Elasticsearch\
**Created:** [September 21, 2020, 8:19am UTC](https://discuss.elastic.co/t/how-to-chose-the-number-of-shards-and-replica/249321 "2020-09-21T08:19:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Abdelhalim](https://avatars.discourse-cdn.com/v4/letter/a/838e76/32.png) [@Abdelhalim](https://discuss.elastic.co/u/Abdelhalim)\
**Post date:** [September 21, 2020, 8:19am UTC](https://discuss.elastic.co/t/how-to-chose-the-number-of-shards-and-replica/249321/1 "2020-09-21T08:19:20Z")

</div>

Hello everybody,

Could you tell me please what is the best rule to calculate the number of shards for the index ? I found this rule but I don't know if it's the best one:

**20 Shards max for each 1 GB of heap on each node**

And how can I chose the number of replicas ?

Thanks for your help.

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [September 21, 2020, 8:21am UTC](https://discuss.elastic.co/t/how-to-chose-the-number-of-shards-and-replica/249321/2 "2020-09-21T08:21:08Z")

</div>

Try to make sure each shard is between 10GB and 50GB in size.

---

<div class="post-metadata">

**Author:** ![Abdelhalim](https://avatars.discourse-cdn.com/v4/letter/a/838e76/32.png) [@Abdelhalim](https://discuss.elastic.co/u/Abdelhalim)\
**Post date:** [September 21, 2020, 8:25am UTC](https://discuss.elastic.co/t/how-to-chose-the-number-of-shards-and-replica/249321/3 "2020-09-21T08:25:47Z")

</div>

Thanks for your reply @Christian_Dahlqvist

I configured the size of shards to 20GB, but I don't know how many shards and replica to chose.  
In my cluser I have 3 master nodes and 2 Data nodes  
The three master Nodes are configured for **hot** data and the 1st Data node for **warm** and the last one for **cold** data

---

<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:** [October 19, 2020, 8:25am UTC](https://discuss.elastic.co/t/how-to-chose-the-number-of-shards-and-replica/249321/4 "2020-10-19T08:25:50Z")

</div>

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