Skip to content

Commit d0104c2

Browse files
authored
Reduce the default number of cached queries. (#26949)
Memory usage of queries can't be properly accounted, which can be an issue when large queries are cached since the actual memory usage will be much higher than what the cache thinks. This problem is very hard if not impossible to fix so as a workaround I would like to decrease the maximum number of cached queries so that this problem is less likely to cause trouble in practice. For the record, this problem is more likely to occur in envirenments that have small shards or don't give much memory to the JVM. Closes #26938
1 parent 93107f8 commit d0104c2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/src/main/java/org/elasticsearch/indices/IndicesQueryCache.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public class IndicesQueryCache extends AbstractComponent implements QueryCache,
5353
public static final Setting<ByteSizeValue> INDICES_CACHE_QUERY_SIZE_SETTING =
5454
Setting.memorySizeSetting("indices.queries.cache.size", "10%", Property.NodeScope);
5555
public static final Setting<Integer> INDICES_CACHE_QUERY_COUNT_SETTING =
56-
Setting.intSetting("indices.queries.cache.count", 10000, 1, Property.NodeScope);
56+
Setting.intSetting("indices.queries.cache.count", 1000, 1, Property.NodeScope);
5757
// enables caching on all segments instead of only the larger ones, for testing only
5858
public static final Setting<Boolean> INDICES_QUERIES_CACHE_ALL_SEGMENTS_SETTING =
5959
Setting.boolSetting("indices.queries.cache.all_segments", false, Property.NodeScope);

0 commit comments

Comments
 (0)