# How does document size affect ElasticSearch performance?

**URL:** <https://discuss.elastic.co/t/how-does-document-size-affect-elasticsearch-performance/260648>\
**Category:** Elasticsearch\
**Created:** [January 10, 2021, 4:07pm UTC](https://discuss.elastic.co/t/how-does-document-size-affect-elasticsearch-performance/260648 "2021-01-10T16:07:29Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![sanchita.jha](https://avatars.discourse-cdn.com/v4/letter/s/8491ac/32.png) [@sanchita.jha](https://discuss.elastic.co/u/sanchita.jha)\
**Post date:** [January 10, 2021, 4:07pm UTC](https://discuss.elastic.co/t/how-does-document-size-affect-elasticsearch-performance/260648/1 "2021-01-10T16:07:29Z")

</div>

Planning to increase document size in elastic, from 4KB to ~100KB each. What is the performance impact with document size increase?

The new fields will have to be additonality used to calculate/modify final scores of documents that are retrieved.

---

<div class="post-metadata">

**Author:** ![sanchita.jha](https://avatars.discourse-cdn.com/v4/letter/s/8491ac/32.png) [@sanchita.jha](https://discuss.elastic.co/u/sanchita.jha)\
**Post date:** [January 10, 2021, 8:16pm UTC](https://discuss.elastic.co/t/how-does-document-size-affect-elasticsearch-performance/260648/2 "2021-01-10T20:16:34Z")

</div>

Planning to keep **doc\_values true** for all the newly added fields.

---

<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:** [January 10, 2021, 10:04pm UTC](https://discuss.elastic.co/t/how-does-document-size-affect-elasticsearch-performance/260648/3 "2021-01-10T22:04:52Z")

</div>

How are you querying? Are you primarily running aggregations or doing searches? How many documents do you typically return? What is driving the increase in document size?

---

<div class="post-metadata">

**Author:** ![sanchita.jha](https://avatars.discourse-cdn.com/v4/letter/s/8491ac/32.png) [@sanchita.jha](https://discuss.elastic.co/u/sanchita.jha)\
**Post date:** [January 11, 2021, 6:46am UTC](https://discuss.elastic.co/t/how-does-document-size-affect-elasticsearch-performance/260648/4 "2021-01-11T06:46:41Z")

</div>

Search + aggregation both. The newly added fields will only be used for script\_score though.  
We return around 30 to150 documents based on use case.

We are adding 4000 extra keys which would ultimately calculate/modify the final \_score of ES docs.

Our cluster is 20 data nodes 200 GB disk size each.

---

<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:** [January 11, 2021, 7:26am UTC](https://discuss.elastic.co/t/how-does-document-size-affect-elasticsearch-performance/260648/5 "2021-01-11T07:26:24Z")

</div>

Reading significantly larger documents from disk could affect performance. It is impossible to determine how much impact it will have though, so I recommend you run a test or benchmark using as realistic data and load as you can to find out.

---

<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:** [February 8, 2021, 7:26am UTC](https://discuss.elastic.co/t/how-does-document-size-affect-elasticsearch-performance/260648/6 "2021-02-08T07:26:31Z")

</div>

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