# Response time much greater than query time in slowlogs - AWS ES

**URL:** <https://discuss.elastic.co/t/response-time-much-greater-than-query-time-in-slowlogs-aws-es/246176>\
**Category:** Elasticsearch\
**Created:** [August 24, 2020, 7:16pm UTC](https://discuss.elastic.co/t/response-time-much-greater-than-query-time-in-slowlogs-aws-es/246176 "2020-08-24T19:16:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jlicheng](https://avatars.discourse-cdn.com/v4/letter/j/ea5d25/32.png) [@jlicheng](https://discuss.elastic.co/u/jlicheng)\
**Post date:** [August 24, 2020, 7:16pm UTC](https://discuss.elastic.co/t/response-time-much-greater-than-query-time-in-slowlogs-aws-es/246176/1 "2020-08-24T19:16:39Z")

</div>

Hi folks, we are using Amazon Elasticsearch and we're seeing a big discrepancy in response time as measured by the code querying Elasticsearch and the slowlogs produced by Elasticsearch.

We've turned on "slowlogs" and generally see it stating queries taking less than 100ms. However, as measured by our code (running in AWS Lambda), we are seeing the query taking at least 500ms to respond. I've tried submitting queries with `profile=true` and see the same pattern -- Elasticsearch reports queries taking less than 100ms to run but it takes close to 300-500ms for us to get a result back.

Our system has very light queries (less than 4 per minute). Light indexing (60 index ops per minute). 8% CPU utilization. ~2,617,471 documents using ~5gb of memory.

It is not obvious to me where to look for this overhead.

I've seen this post [Elasticsearch 7.2 slow query after update](https://discuss.elastic.co/t/elasticsearch-7-2-slow-query-after-update/189784) but I'm not sure if our problem is related. We'll probably try fiddling`index.refresh_interval`and `index.search.idle.after` this week to see if it makes a different. Though I'd love to get suggestions on what else might be going on here.

Thanks in advance,  
John

---

<div class="post-metadata">

**Author:** ![jlicheng](https://avatars.discourse-cdn.com/v4/letter/j/ea5d25/32.png) [@jlicheng](https://discuss.elastic.co/u/jlicheng)\
**Post date:** [August 25, 2020, 6:51pm UTC](https://discuss.elastic.co/t/response-time-much-greater-than-query-time-in-slowlogs-aws-es/246176/2 "2020-08-25T18:51:15Z")

</div>

After explicitly `index.refresh_interval` to `1s`, we started to see much lower response time from the Elasticsearch cluster.

It appears that `index.refresh_interval` has been overloaded to carry two meanings

1. Its value defines how the frequency of refresh
2. The absence of an explicit override to the default defines whether to block search queries or not

---

<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:** [September 22, 2020, 6:51pm UTC](https://discuss.elastic.co/t/response-time-much-greater-than-query-time-in-slowlogs-aws-es/246176/3 "2020-09-22T18:51:20Z")

</div>

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