# Max number of shards per elastic data node

**URL:** https://discuss.elastic.co/t/max-number-of-shards-per-elastic-data-node/174572
**Category:** Elasticsearch
**Created:** [March 29, 2019, 4:15pm UTC](https://discuss.elastic.co/t/max-number-of-shards-per-elastic-data-node/174572 "2019-03-29T16:15:48Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![githubkatten](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/githubkatten/32/43110_2.png) [@githubkatten](https://discuss.elastic.co/u/githubkatten)
#### Post date: [March 29, 2019, 4:15pm UTC](https://discuss.elastic.co/t/max-number-of-shards-per-elastic-data-node/174572/1 "2019-03-29T16:15:48Z")

</div>

Hi!  
I've found out that the recommended number of shards per elasticsearch data node is  
20 \* GB heap memory. Ex. if I got a node with 16GB java heap, it can handle 20\*16=320 shards.  
Is this rule of thumb for open indices or closed indices?  
We use ES 5.5.2

BR Andreas

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [March 29, 2019, 5:14pm UTC](https://discuss.elastic.co/t/max-number-of-shards-per-elastic-data-node/174572/2 "2019-03-29T17:14:45Z")

</div>

This is for open indices.

---

<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: [March 29, 2019, 5:31pm UTC](https://discuss.elastic.co/t/max-number-of-shards-per-elastic-data-node/174572/3 "2019-03-29T17:31:19Z")

</div>

That is a rule of thumb for the maximum number of shards as we see a lot of clusters that vare massively oversharded. I would recommend having fewer than this if possible. Although closed indices do not use any heap, they do increase the size of the cluster state, so are not completely free either.

---

<div class="post-metadata">

### Author: ![githubkatten](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/githubkatten/32/43110_2.png) [@githubkatten](https://discuss.elastic.co/u/githubkatten)
#### Post date: [April 1, 2019, 10:29am UTC](https://discuss.elastic.co/t/max-number-of-shards-per-elastic-data-node/174572/4 "2019-04-01T10:29:15Z")

</div>

Hi @dadoonet and @Christian_Dahlqvist !  
Thank you for your answers, we will try to keep the shards as few as possible.  
Regarding memory use, if I have 5p and 1r = total 10 open shards per index, I assume that both primary and replica shards will be using memory?  
BR Andreas

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [April 1, 2019, 11:05am UTC](https://discuss.elastic.co/t/max-number-of-shards-per-elastic-data-node/174572/5 "2019-04-01T11:05:18Z")

</div>

Yes.

---

<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: [April 29, 2019, 11:05am UTC](https://discuss.elastic.co/t/max-number-of-shards-per-elastic-data-node/174572/6 "2019-04-29T11:05:24Z")

</div>

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