ES_SHARD_CACHE_EVICTION_MEM
elasticsearch
resource_error
ai_generated
true
ElasticsearchException: shard request cache eviction triggered memory pressure, current heap usage [85%]
ID: elasticsearch/shard-request-cache-eviction-memory-pressure
83%Fix Rate
88%Confidence
1Evidence
2024-09-01First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 7.17.0 | active | — | — | — |
| 8.11.0 | active | — | — | — |
| 8.12.0 | active | — | — | — |
Root Cause
The shard request cache grows too large under high query load, causing frequent evictions that increase heap pressure and degrade performance.
generic中文
在高查询负载下,分片请求缓存增长过大,导致频繁逐出,增加堆压力并降低性能。
Official Documentation
https://www.elastic.co/guide/en/elasticsearch/reference/current/shard-request-cache.htmlWorkarounds
-
80% success Reduce cache size by setting `indices.requests.cache.size: 1%` in `elasticsearch.yml` to limit heap usage.
Reduce cache size by setting `indices.requests.cache.size: 1%` in `elasticsearch.yml` to limit heap usage.
-
85% success Use explicit query caching with `?request_cache=true` only for queries that benefit from it, and set `index.requests.cache.enable: false` on indices with high write volume.
Use explicit query caching with `?request_cache=true` only for queries that benefit from it, and set `index.requests.cache.enable: false` on indices with high write volume.
-
90% success Monitor cache eviction rates via `GET _nodes/stats/indices/request_cache` and optimize queries to reduce cache churn.
Monitor cache eviction rates via `GET _nodes/stats/indices/request_cache` and optimize queries to reduce cache churn.
中文步骤
Reduce cache size by setting `indices.requests.cache.size: 1%` in `elasticsearch.yml` to limit heap usage.
Use explicit query caching with `?request_cache=true` only for queries that benefit from it, and set `index.requests.cache.enable: false` on indices with high write volume.
Monitor cache eviction rates via `GET _nodes/stats/indices/request_cache` and optimize queries to reduce cache churn.
Dead Ends
Common approaches that don't work:
-
70% fail
Larger heap delays evictions but doesn't solve the root cause of excessive caching; cache can grow unbounded and cause GC issues.
-
65% fail
Disabling cache increases query latency for repeated queries, especially in dashboards or reporting scenarios.