Search latencies improve progressively each request after index refreshes

I am running a single local instance of elasticsearch. I noticed after indexing is done, when I run a few of the same exact search queries, they get progressively faster. The first one is 80ms, the second 40ms, the third 30ms, the fourth 25ms, and the fifth 25ms.

Why does this happen?

Is there some caching going on that progressively warms up in increments? I tried turning on/off for nvd/dvd, but that doesn't seem to make a difference.

The OS starts caching files in memory most likely.

Any other ways to try to load it into memory or filesystem caches?

You can run some queries before serving requests to the user so it will "warm" your index.

Do you suppose that we would need to replicate the entire search query/phrase space (relatively large for us) or just a single wildcard query that would pull the entire document index out? Both could be done before serving live requests.

Thanks, David!

I believe that a query which would load all segments (basically all terms) would be ok.
I think that you might need to visit all the fields that will be used in a search then.

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