# Scan/scroll - optimal "size" parameter

**URL:** <https://discuss.elastic.co/t/scan-scroll-optimal-size-parameter/32038>\
**Category:** Elasticsearch\
**Created:** [October 12, 2015, 8:40pm UTC](https://discuss.elastic.co/t/scan-scroll-optimal-size-parameter/32038 "2015-10-12T20:40:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![liorg2](https://avatars.discourse-cdn.com/v4/letter/l/ed8c4c/32.png) [@liorg2](https://discuss.elastic.co/u/liorg2)\
**Post date:** [October 12, 2015, 8:40pm UTC](https://discuss.elastic.co/t/scan-scroll-optimal-size-parameter/32038/1 "2015-10-12T20:40:03Z")

</div>

hello,

is there a way to determine the value of the "size" parameter, to make an import, using scan/scroll, to be the fastest?  
for example, is "size=100000" too much for elasticsearch ?

---

<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:** [October 12, 2015, 11:47pm UTC](https://discuss.elastic.co/t/scan-scroll-optimal-size-parameter/32038/2 "2015-10-12T23:47:12Z")

</div>

Having a very large the size can be dangerous, as it grabs that number of documents for _all_ shards in an index.

So if you change this to 100000 and you have 10 shards, that is 1000000 documents it will fetch, which will have an impact on heap use.

---

<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:** [July 5, 2017, 11:45pm UTC](https://discuss.elastic.co/t/scan-scroll-optimal-size-parameter/32038/3 "2017-07-05T23:45:15Z")

</div>


