# Elasticsearch Shards

**URL:** <https://discuss.elastic.co/t/elasticsearch-shards/94360>\
**Category:** Elasticsearch\
**Created:** [July 24, 2017, 3:58pm UTC](https://discuss.elastic.co/t/elasticsearch-shards/94360 "2017-07-24T15:58:39Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![telebh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/telebh/32/42272_2.png) [@telebh](https://discuss.elastic.co/u/telebh)\
**Post date:** [July 24, 2017, 3:58pm UTC](https://discuss.elastic.co/t/elasticsearch-shards/94360/1 "2017-07-24T15:58:39Z")

</div>

Hi there,

we are planning to create a Prod Elasticsearch cluster of "2" data nodes and "3" master nodes. we expect to have total 22 M documents to index where we have one single index. what is the optimal number/size of shards to use? by the way does master nodes counts toward #of shards or only data nodes?

---

<div class="post-metadata">

**Author:** ![xavierfacq](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/xavierfacq/32/8744_2.png) [@xavierfacq](https://discuss.elastic.co/u/xavierfacq)\
**Post date:** [July 24, 2017, 8:05pm UTC](https://discuss.elastic.co/t/elasticsearch-shards/94360/2 "2017-07-24T20:05:29Z")

</div>

Hi,

Master nodes can be small and do not store any datas. Number of shards for your index depends of the total size of your 22M documents after indexation. My rule of tumb is ~10Go per shard.

---

<div class="post-metadata">

**Author:** ![telebh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/telebh/32/42272_2.png) [@telebh](https://discuss.elastic.co/u/telebh)\
**Post date:** [July 24, 2017, 8:13pm UTC](https://discuss.elastic.co/t/elasticsearch-shards/94360/3 "2017-07-24T20:13:57Z")

</div>

Thanks for providing the info. doc size varies in terms of kb (i.e. 10kb - 400kb). the estimated total storage we expect is 4TB. so in this case should we calculate # of shards based on data nodes ? for example if we have 3 master nodes and 2 data nodes, so in this case can we consider # of shards 2\* 2 = 4 shards?

---

<div class="post-metadata">

**Author:** ![xavierfacq](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/xavierfacq/32/8744_2.png) [@xavierfacq](https://discuss.elastic.co/u/xavierfacq)\
**Post date:** [July 24, 2017, 8:40pm UTC](https://discuss.elastic.co/t/elasticsearch-shards/94360/4 "2017-07-24T20:40:35Z")

</div>

You should try to index some documents and look at the size, because it depends on what type of datas you are going to index (integer, string, keywords, synonymes, etc...)  
For exemple, I have a 130M documents indexed having a size of 32Go. Number of shards in my case si 8 primaries. So each shard is about 4Go.  
With 2 data nodes, If you have 1 index with 8 shards, each node will hold 4 shards. If you add 1 replica, they will hold 8 shards. Make some tests.

---

<div class="post-metadata">

**Author:** ![telebh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/telebh/32/42272_2.png) [@telebh](https://discuss.elastic.co/u/telebh)\
**Post date:** [July 25, 2017, 12:06am UTC](https://discuss.elastic.co/t/elasticsearch-shards/94360/5 "2017-07-25T00:06:54Z")

</div>

many thanks for your thorough explanation, that helps.

---

<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:** [August 22, 2017, 12:07am UTC](https://discuss.elastic.co/t/elasticsearch-shards/94360/6 "2017-08-22T00:07:24Z")

</div>

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