# Empty Slices with Scan/Scroll

**URL:** https://discuss.elastic.co/t/empty-slices-with-scan-scroll/127255
**Category:** Elasticsearch
**Tags:** es-hadoop
**Created:** [April 9, 2018, 6:43am UTC](https://discuss.elastic.co/t/empty-slices-with-scan-scroll/127255 "2018-04-09T06:43:27Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![bevans88](https://avatars.discourse-cdn.com/v4/letter/b/a698b9/32.png) [@bevans88](https://discuss.elastic.co/u/bevans88)
#### Post date: [April 9, 2018, 6:43am UTC](https://discuss.elastic.co/t/empty-slices-with-scan-scroll/127255/1 "2018-04-09T06:43:27Z")

</div>

Hi,

We're currently using Spark with es-hadoop to read 1 million documents from an Elasticsearch index. The sliced scan scroll that it is using internally is not evenly distributing the results across the slices; in fact all but 1 slice is empty for each shard preferenced scan scroll;

- Elasticsearch 6.0.0
- Single node cluster for testing
- 5 Shards
- 1 million documents in an index
- es.input.max.docs.per.partition set to 50k

1. Match All query is run to obtain all documents from the index; this results in 5 scan scrolls with 4 slices each.
2. Of the 4 slices in each scan scroll only 1 of them contains any results (~ 200k).

Is there anyway to evenly distribute the results across the slices? I believe this may be the same issue as that described in [https://github.com/elastic/elasticsearch/issues/27550](https://github.com/elastic/elasticsearch/issues/27550).

Thanks,

Brent

---

<div class="post-metadata">

### Author: ![james.baiera](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/james.baiera/32/10209_2.png) [@james.baiera](https://discuss.elastic.co/u/james.baiera)
#### Post date: [April 9, 2018, 6:15pm UTC](https://discuss.elastic.co/t/empty-slices-with-scan-scroll/127255/2 "2018-04-09T18:15:35Z")

</div>

It's possible that you are running into that linked issue. If that is the case, there's not much that we can do in terms of balancing the sliced scrolls. You could set the es.input.max.docs.per.parition setting to a really high number like MAX\_INT which should effectively disable the slicing features. This would only eliminate the overhead of those empty tasks from the empty slices.

---

<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: [May 7, 2018, 6:16pm UTC](https://discuss.elastic.co/t/empty-slices-with-scan-scroll/127255/3 "2018-05-07T18:16:07Z")

</div>

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