# How to calculate shard\_size

**URL:** <https://discuss.elastic.co/t/how-to-calculate-shard-size/258664>\
**Category:** Elasticsearch\
**Created:** [December 15, 2020, 2:10am UTC](https://discuss.elastic.co/t/how-to-calculate-shard-size/258664 "2020-12-15T02:10:21Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![mohammad\_hanifah\_nur](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mohammad_hanifah_nur/32/78511_2.png) [@mohammad\_hanifah\_nur](https://discuss.elastic.co/u/mohammad_hanifah_nur)\
**Post date:** [December 15, 2020, 2:10am UTC](https://discuss.elastic.co/t/how-to-calculate-shard-size/258664/1 "2020-12-15T02:10:21Z")

</div>

this issue came when i trying to find a top ten summary amount with aggregation by term variable A.  
variable A have a lot of unique data . that makes the result of the top ten summary amount is invalid.

the first thing i have try is to using 1000 size but the result still invalid.  
After that i try using 30000 shard\_size and make the size become 10 and the result is valid.  
its solve my problem right now .

**but why 30000 shard size . how to calculate the exact shard\_size to use in aggregation term ?**  
notes : my variable A unique data is 6.800.000 unique data .

---

<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:** [December 15, 2020, 2:12am UTC](https://discuss.elastic.co/t/how-to-calculate-shard-size/258664/2 "2020-12-15T02:12:23Z")

</div>

Welcome to our community! 😃

How many GB is your data?

---

<div class="post-metadata">

**Author:** ![mohammad\_hanifah\_nur](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mohammad_hanifah_nur/32/78511_2.png) [@mohammad\_hanifah\_nur](https://discuss.elastic.co/u/mohammad_hanifah_nur)\
**Post date:** [December 15, 2020, 2:21am UTC](https://discuss.elastic.co/t/how-to-calculate-shard-size/258664/3 "2020-12-15T02:21:25Z")

</div>

thank you warkolm.

the data size of my index is  
3,5GB

---

<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:** [December 15, 2020, 2:29am UTC](https://discuss.elastic.co/t/how-to-calculate-shard-size/258664/4 "2020-12-15T02:29:07Z")

</div>

Why not just make it a single shard (with replicas). Unless you are expecting the ultimate data size to be massive, it should be fine with one.

---

<div class="post-metadata">

**Author:** ![mohammad\_hanifah\_nur](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mohammad_hanifah_nur/32/78511_2.png) [@mohammad\_hanifah\_nur](https://discuss.elastic.co/u/mohammad_hanifah_nur)\
**Post date:** [December 15, 2020, 2:41am UTC](https://discuss.elastic.co/t/how-to-calculate-shard-size/258664/5 "2020-12-15T02:41:20Z")

</div>

iam so sorry to be honest i dont get what this means,  
is single shard means shard\_size =1 ?  
but when shard\_size below 30.000 the result of aggregation is invalid .

---

<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:** [January 12, 2021, 2:41am UTC](https://discuss.elastic.co/t/how-to-calculate-shard-size/258664/6 "2021-01-12T02:41:21Z")

</div>

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