What about caching


(Christos Markou) #1

Hey guys,

i am testing the performance of my ES cluster. I am indexing artificial documents in high rate and then i perform searches in them. I do full text search (from a client programm). The results are really good!
What i need to know is in what measure the cache is responsible for these results?
Is the answer of the result cashed after the first search? In marvel dashboard i don't see any increase in the graphs that are familiar with cache performance.
I have read a lot but i didn't manage to figure out what exactly is rigth.

Any info would be appreciated!


(Mark Walkom) #2

Depends on your query. Filters are cached and ES will also store some of the field data in heap as well.

Both of which improve performance.


(Dong Hyun Kim) #3

filters are cached in bitset, and managed by LRU manner.

this may helpful


(Christos Markou) #4

Ok thanx everyone!

I am already familiar with filters and bitsets. The search i used in my tests is full-text search with no filters so bitsets doesn't participate in this case.

In my case i want to disable, somehow, the participation of any caching, and see what would happen.
From the documention:
https://www.elastic.co/guide/en/elasticsearch/reference/current/index-modules-fielddata.html if i set indices.fielddata.cache.size to 0% can i ahcive that?


(Colin Goodheart-Smithe) #5

Unless you are using sorting, aggregations or nested/parent-child docs in your queries the field data cache will not be used. Elasticsearch (and Lucene) heavily use the OS file system cache to cache index files and avoid going to disk.

When you first run a search the segments being read off the disk will be loaded into the OS file system cache automatically by the OS so that subsequent accesses to that file can be done in memory rather than having to go back to the disk. Because Lucene 'never modifies a file' this works very well with the file system cache and means that the file never needs to be invalidated in the cache. You won't be able to turn this caching off as it's done automatically by the OS.

Could you explain why you are wanting to disable caching? It's built in to improve performance.


(Christos Markou) #6

Ok got it!

Of course cache is bulit to improve performance but i want to experiment on how the search will go without having the cache enabled, and compare response times for example.
Anyway, thanx for the explanation!


(system) #7