# Formula to estimate optimal number of shards giving input parametes ( heap-size, average-index-size, etc...)

**URL:** https://discuss.elastic.co/t/formula-to-estimate-optimal-number-of-shards-giving-input-parametes-heap-size-average-index-size-etc/200975
**Category:** Elasticsearch
**Created:** [September 25, 2019, 7:27am UTC](https://discuss.elastic.co/t/formula-to-estimate-optimal-number-of-shards-giving-input-parametes-heap-size-average-index-size-etc/200975 "2019-09-25T07:27:01Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![dbergamo](https://avatars.discourse-cdn.com/v4/letter/d/a88e4f/32.png) [@dbergamo](https://discuss.elastic.co/u/dbergamo)
#### Post date: [September 25, 2019, 7:27am UTC](https://discuss.elastic.co/t/formula-to-estimate-optimal-number-of-shards-giving-input-parametes-heap-size-average-index-size-etc/200975/1 "2019-09-25T07:27:01Z")

</div>

Hello guys,  
i have read some discussion topic on how to tune-up logstash configuration, and for what i have understand there are a bunch of variables and metrics that should be related.  
I.e:

- average shard's size should be between 20GB and 40GB
- the total number of shards inside a node should be 20\*(GB-heap-size)
- ......

I wonder if, fixing some assertions ( ex: indexes are daily-time-based ), exists some math formula that consent to estimate the optimal shards number compatible with input parameter ( number of nodes, GB-heap-size for nodes, average daily indexes size, total number of indexes created daily, retention period for an index ).

I'd like to have some automatic computation that could help me to visualize different tuning option corresponding to different input parameters value .  
Just some starting formula to have some rapid feedback, i'm not involved in modeling machine-learning auto-predicting models 🙂 ) .

Thank u all for the feedback  
Regards,  
Diego B

---

<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 23, 2019, 7:27am UTC](https://discuss.elastic.co/t/formula-to-estimate-optimal-number-of-shards-giving-input-parametes-heap-size-average-index-size-etc/200975/2 "2019-10-23T07:27:02Z")

</div>

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