# Scroll/Scan API, pockets of slow responses while scrolling

**URL:** <https://discuss.elastic.co/t/scroll-scan-api-pockets-of-slow-responses-while-scrolling/24571>\
**Category:** Elasticsearch\
**Created:** [June 29, 2015, 8:23pm UTC](https://discuss.elastic.co/t/scroll-scan-api-pockets-of-slow-responses-while-scrolling/24571 "2015-06-29T20:23:42Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![javadevmtl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/javadevmtl/32/45613_2.png) [@javadevmtl](https://discuss.elastic.co/u/javadevmtl)\
**Post date:** [June 29, 2015, 8:23pm UTC](https://discuss.elastic.co/t/scroll-scan-api-pockets-of-slow-responses-while-scrolling/24571/1 "2015-06-29T20:23:42Z")

</div>

Using ES 1.6.0

I have the following query using Transport Client

```
client.prepareSearch("my-index").setTypes("my-type")
				.setQuery(query.getBytes())
				.setSearchType(SearchType.SCAN)
				.addFields(
						"my-field-1",
						"my-field-2"
						)
						.setScroll(new TimeValue(60000))
						.setSize(500)
						.execute().actionGet();

```

The query...

```
{
	"filtered": {
      "filter": {
        "bool": {
          "must": [
            {
              "term": {
                "my-user": "100000"
              }
            },
            {
              "range": {
                "my-date": {
                  "gte": "2015-03-01",
                  "lte": "2015-03-31"
                }
              }
            },
            {
              "bool": {
                "should": [
                  {
                    "term": {
                      "shape": "triangle"
                    }
                  },
                  {
                    "term": {
                      "shape": "circle"
                    }
                  }
                ]
              }
            }
          ]
        }
      }
    }
}

```

The query has been redacted to protect the innocent 😄 (It's the actual query just field names/values where renamed)

The index is 260 million documents, the query produces 30 million hits.

So on each scroll request I print the took ms using, scrollResp.getTookInMillis(). I see pockets of slowness. So some scroll requests will burst with took time of 50ms and other times each scroll will take 4-5 seconds and then it will burst again. And some times each scroll request will humm around 300ms.

---

<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:** [June 30, 2015, 5:35am UTC](https://discuss.elastic.co/t/scroll-scan-api-pockets-of-slow-responses-while-scrolling/24571/2 "2015-06-30T05:35:12Z")

</div>

It could be many things! What are you monitoring ES with?

---

<div class="post-metadata">

**Author:** ![javadevmtl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/javadevmtl/32/45613_2.png) [@javadevmtl](https://discuss.elastic.co/u/javadevmtl)\
**Post date:** [June 30, 2015, 12:33pm UTC](https://discuss.elastic.co/t/scroll-scan-api-pockets-of-slow-responses-while-scrolling/24571/3 "2015-06-30T12:33:28Z")

</div>

Windows perfmon, fusion io manager and marvel

---

<div class="post-metadata">

**Author:** ![javadevmtl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/javadevmtl/32/45613_2.png) [@javadevmtl](https://discuss.elastic.co/u/javadevmtl)\
**Post date:** [June 30, 2015, 12:38pm UTC](https://discuss.elastic.co/t/scroll-scan-api-pockets-of-slow-responses-while-scrolling/24571/4 "2015-06-30T12:38:39Z")

</div>

I also find it very spiky. For instance all the io stats are very spiky. With fusion io monitoring I see lots of io spike but nothing consistant. I seen it go all the way to 1GB per second reads some time almost idle sometimes it hums along around 50mb per second reads. Other time it spikes up to 500mb then drops then again spikes and drops. For the same scroll operation

---

<div class="post-metadata">

**Author:** ![javadevmtl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/javadevmtl/32/45613_2.png) [@javadevmtl](https://discuss.elastic.co/u/javadevmtl)\
**Post date:** [June 30, 2015, 1:46pm UTC](https://discuss.elastic.co/t/scroll-scan-api-pockets-of-slow-responses-while-scrolling/24571/5 "2015-06-30T13:46:18Z")

</div>

![](https://us1.discourse-cdn.com/elastic/original/2X/e/ebe2668d9a922d282937777371057a00c2c9ef09.png)

As you can see it's not very consistent.

---

<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 6, 2017, 12:04am UTC](https://discuss.elastic.co/t/scroll-scan-api-pockets-of-slow-responses-while-scrolling/24571/6 "2017-07-06T00:04:33Z")

</div>


