# Initial Latency problem

**URL:** <https://discuss.elastic.co/t/initial-latency-problem/41132>\
**Category:** Elasticsearch\
**Created:** [February 7, 2016, 5:50am UTC](https://discuss.elastic.co/t/initial-latency-problem/41132 "2016-02-07T05:50:38Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mario\_Rodrigues](https://avatars.discourse-cdn.com/v4/letter/m/958977/32.png) [@Mario\_Rodrigues](https://discuss.elastic.co/u/Mario_Rodrigues)\
**Post date:** [February 7, 2016, 5:50am UTC](https://discuss.elastic.co/t/initial-latency-problem/41132/1 "2016-02-07T05:50:38Z")

</div>

I'm using ES to provide an autocomplete search and, sometimes, the search can take up to 10 seconds but then it's really fluid.

I took a look at my application monitor and found that the problem is the ES response time:  
[![](https://dl.dropboxusercontent.com/s/su3m0kxe9wp29yb/Screenshot%202016-02-07%2005.42.35.png?dl=0) ](https://dl.dropboxusercontent.com/s/su3m0kxe9wp29yb/Screenshot%202016-02-07%2005.42.35.png?dl=0)

I'm using a single node "cluster" with 1 Gb and it only has around 2 megabytes worth of data.

What can I do to fix this problem?

---

<div class="post-metadata">

**Author:** ![AndreKR](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrekr/32/6233_2.png) [@AndreKR](https://discuss.elastic.co/u/AndreKR)\
**Post date:** [February 7, 2016, 6:06am UTC](https://discuss.elastic.co/t/initial-latency-problem/41132/2 "2016-02-07T06:06:23Z")

</div>

Does this occur after a period of not using it? Might have been swapped out. Do you have swap enabled? See also: [https://www.elastic.co/guide/en/elasticsearch/reference/current/setup-configuration.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/setup-configuration.html)

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [February 7, 2016, 6:07am UTC](https://discuss.elastic.co/t/initial-latency-problem/41132/3 "2016-02-07T06:07:11Z")

</div>

How do you perform your autocomplete search? Are you using [edge ngrams](https://www.elastic.co/guide/en/elasticsearch/guide/master/_index_time_search_as_you_type.html#_preparing_the_index)?

---

<div class="post-metadata">

**Author:** ![Mario\_Rodrigues](https://avatars.discourse-cdn.com/v4/letter/m/958977/32.png) [@Mario\_Rodrigues](https://discuss.elastic.co/u/Mario_Rodrigues)\
**Post date:** [February 11, 2016, 8:31pm UTC](https://discuss.elastic.co/t/initial-latency-problem/41132/4 "2016-02-11T20:31:50Z")

</div>

I'm using a filtered query and I'm not using edge grams or anything that could justify the performance penalty. I've the same setup on another project and I don't have this problem at all. I'm using version 1.7 and I don't if the recent [found.no](http://found.no) migration could explain this.

---

<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:17pm UTC](https://discuss.elastic.co/t/initial-latency-problem/41132/5 "2017-07-05T23:17:00Z")

</div>


