Very few shard query cache hits


(Thomas Widhalm) #1

Hi!

I enabled the shard query cache on my indices and gave a bit more of the heap to this sort of cache in an Elasticsearch 1.7.1 cluster. When I repeatedly run a Kibana dashboard with lots of terms aggregations and line charts with date histogram aggregation with count or unique count on this cluster I expected to have many hits on this cache, at least when I use a timespan of last 7 days.

Instead Elasticsearch shows me about 80 hits and 12000 misses per node (I just had the nodes restarted).

This sort of cache should store all countresults per shard, so when I query old shards I expect lots of hits. Did I misunderstand the shard query cache?

Cheers,
Thomas


(Adrien Grand) #2

This cache is invalidated every time that the index needs to be reopened, which could be every second if you keep on adding data to your index. Maybe this explains the issue you are seeing?


(Thomas Widhalm) #3

Thanks for your reply.

I have daily new indices and I don't write to old indices (at least I hope so, otherwise there would be lots of misconfigured NTP clients, out there), but I don't close them either, just to be sure.

I expect lots of misses when I do searches on todays index, but I would expect a lot more hits when I do searches over the last 7 days or 30 days. This is what keeps me wondering.


(Alexander Reelsen) #4

Hey,

do you see the cache in action when you specify fixed intervals? See https://github.com/elastic/kibana/issues/2577 - I assume you are using kibana?

--Alex


(system) #5