# Slow first request on an index after a short amount of time

**URL:** <https://discuss.elastic.co/t/slow-first-request-on-an-index-after-a-short-amount-of-time/219292>\
**Category:** Elasticsearch\
**Created:** [February 13, 2020, 11:28pm UTC](https://discuss.elastic.co/t/slow-first-request-on-an-index-after-a-short-amount-of-time/219292 "2020-02-13T23:28:12Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [February 14, 2020, 9:48am UTC](https://discuss.elastic.co/t/slow-first-request-on-an-index-after-a-short-amount-of-time/219292/4 "2020-02-14T09:48:51Z")

</div>

Hmm, a proportionate slowdown isn't what I expected, but perhaps there's more than one effect here.

The main contributor will be, I think, the [interaction of `index.refresh_interval` and `index.search.idle.after`](https://www.elastic.co/guide/en/elasticsearch/reference/current/index-modules.html#dynamic-index-settings). If you do not search a shard for 30 seconds (by default) then it will stop refreshing to save resources. The next search that you do will trigger a refresh within the next second (by default) and will wait for that to complete first.

Perhaps the best way to test whether this is the problem is to increase `index.search.idle.after` to a longer time, say 10 minutes, and see whether this speeds things up for searches spaced 30-60 seconds apart. Could you try that and see if it helps?

---

_[View the full topic](https://discuss.elastic.co/t/slow-first-request-on-an-index-after-a-short-amount-of-time/219292)._
