Skip to content

Commit

Permalink
Increase the maximum number of filters that may be in the cache. (#30655
Browse files Browse the repository at this point in the history
)

We added this limit because we occasionally saw cases where most of the memory
usage of the cache was spent on the keys (ie. queries) rather than the values,
which caused the cache to vastly underestimate its memory usage. In recent
releases, we disabled caching on heavy `terms` queries, which were the main
source of the problem, so putting more entries in the cache should be safer.
  • Loading branch information
jpountz committed May 22, 2018
1 parent 369d14c commit 2cf0e4f
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,10 @@ public class IndicesQueryCache extends AbstractComponent implements QueryCache,

public static final Setting<ByteSizeValue> INDICES_CACHE_QUERY_SIZE_SETTING =
Setting.memorySizeSetting("indices.queries.cache.size", "10%", Property.NodeScope);
// mostly a way to prevent queries from being the main source of memory usage
// of the cache
public static final Setting<Integer> INDICES_CACHE_QUERY_COUNT_SETTING =
Setting.intSetting("indices.queries.cache.count", 1000, 1, Property.NodeScope);
Setting.intSetting("indices.queries.cache.count", 10_000, 1, Property.NodeScope);
// enables caching on all segments instead of only the larger ones, for testing only
public static final Setting<Boolean> INDICES_QUERIES_CACHE_ALL_SEGMENTS_SETTING =
Setting.boolSetting("indices.queries.cache.all_segments", false, Property.NodeScope);
Expand Down

0 comments on commit 2cf0e4f

Please sign in to comment.