How to disable caching when testing Elastic Search

I am experiencing stress testing of Elastic Search by submitting queries, but I'm afraid that the responses are cached. How to disable caching when testing Elastic Search?

+12
elasticsearch
source share
2 answers

Before I answer, the disclaimer, which I agree with the comments on the issue, disabling the cache is not the best way to stress test Elasticsearch. Getting into it simultaneous queries representing your production set of queries and active indexing at the same time will be a much better way to see how the ES responds under load.

However, to answer your question and point out some caveats:

  1. You can clear the cache between starts:

    The cache clear API allows you to clear either all caches, or specific caching is associated with one or more indexes.

    https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-clearcache.html

  2. You can disable the filter cache by setting index.cache.filter.type to none - this will prevent filtering results from the cache:

    http://elasticsearch-users.115913.n3.nabble.com/Disable-cache-td3825105.html

    http://elasticsearch-users.115913.n3.nabble.com/Disabling-cache-td3201850.html

  3. You can change the settings for the field data cache - however, I do not know what will happen if you set this to zero:

    https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-fielddata.html

  4. In general, keep in mind that Elasticsearch makes significant use of the native OS file system cache, so most of the "caching" occurs outside of ES control:

    https://blog.codecentric.de/en/2014/05/elasticsearch-indexing-performance-cheatsheet/

+16
source share
0
source share

All Articles