ES_SHARD_CACHE_EVICTION_MEM
elasticsearch
resource_error
ai_generated
true
Elasticsearch异常:分片请求缓存逐出触发内存压力,当前堆使用率 [85%]
ElasticsearchException: shard request cache eviction triggered memory pressure, current heap usage [85%]
ID: elasticsearch/shard-request-cache-eviction-memory-pressure
83%修复率
88%置信度
1证据数
2024-09-01首次发现
版本兼容性
| 版本 | 状态 | 引入 | 弃用 | 备注 |
|---|---|---|---|---|
| 7.17.0 | active | — | — | — |
| 8.11.0 | active | — | — | — |
| 8.12.0 | active | — | — | — |
根因分析
在高查询负载下,分片请求缓存增长过大,导致频繁逐出,增加堆压力并降低性能。
English
The shard request cache grows too large under high query load, causing frequent evictions that increase heap pressure and degrade performance.
官方文档
https://www.elastic.co/guide/en/elasticsearch/reference/current/shard-request-cache.html解决方案
-
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.
无效尝试
常见但无效的做法:
-
70% 失败
Larger heap delays evictions but doesn't solve the root cause of excessive caching; cache can grow unbounded and cause GC issues.
-
65% 失败
Disabling cache increases query latency for repeated queries, especially in dashboards or reporting scenarios.