Filter cache implementation details

As specified in documentation node-filter-cache
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/index-modules-cache.html#node-filter
:

The cache implements an LRU eviction policy: when a cache becomes full, the

least recently used data is evicted to make way for new data.

But in source code I found filter cache implementation:

So the cache will evict entries that consumes more memory. I think this
policy is not the best choice cause fat entries can be used quite
frequently. May be there should be several implementation of filter cache
as Solr does.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/aea81973-2aa1-4f14-9832-6a1ffef3cd30%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

I don't think the current filter cache evicts entries that consume more
memory first. The weight part is only used to evict when the filter cache
size (in terms of bytes, not entries) grows beyond a configured limit.

I agree this behaviour is quite simplistic and there are two interesting
things that can be improved:

  • the decision about which entries to evict first
  • the decision about which entries to cache at all

If you are interested, there are improvements currently being worked on for
the later issue: Filter cache: add a `_cache: auto` option and make it the default. by jpountz · Pull Request #8573 · elastic/elasticsearch · GitHub

On Tue, Dec 2, 2014 at 4:56 PM, Alexander Koval kovalidis@gmail.com wrote:

As specified in documentation node-filter-cache
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/index-modules-cache.html#node-filter
:

The cache implements an LRU eviction policy: when a cache becomes full,

the least recently used data is evicted to make way for new data.

But in source code I found filter cache implementation:

So the cache will evict entries that consumes more memory. I think this
policy is not the best choice cause fat entries can be used quite
frequently. May be there should be several implementation of filter cache
as Solr does.

--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/aea81973-2aa1-4f14-9832-6a1ffef3cd30%40googlegroups.com
https://groups.google.com/d/msgid/elasticsearch/aea81973-2aa1-4f14-9832-6a1ffef3cd30%40googlegroups.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
Adrien Grand

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAL6Z4j6pyv4G%2BbSSczxg3k6KtA17f1iMMU%3DX%3DwX4o-xe3jdvQA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.