gpt4 book ai didi

Elasticsearch 7.x 断路器 - 数据过大 - 故障排除

转载 作者:行者123 更新时间:2023-12-02 22:09:55 36 4
gpt4 key购买 nike

问题:
自从从 ES-5.4 升级到 ES-7.2 后,当我尝试从我的多线程 Java 应用程序(使用 elasticsearch-rest-high-level-client-7.2.0.jar java 客户端)写入并发批量请求(或/和搜索请求)时,我开始收到“数据太大”错误到 2-4 个节点的 ES 集群。

我的 ES 配置:

Elasticsearch version: 7.2

custom configuration in elasticsearch.yml:
thread_pool.search.queue_size = 20000
thread_pool.write.queue_size = 500

I use only the default 7.x circuit-breaker values, such as:
indices.breaker.total.limit = 95%
indices.breaker.total.use_real_memory = true
network.breaker.inflight_requests.limit = 100%
network.breaker.inflight_requests.overhead = 2

来自 elasticsearch.log 的错误:
    {
"error": {
"root_cause": [
{
"type": "circuit_breaking_exception",
"reason": "[parent] Data too large, data for [<http_request>] would be [3144831050/2.9gb], which is larger than the limit of [3060164198/2.8gb], real usage: [3144829848/2.9gb], new bytes reserved: [1202/1.1kb]",
"bytes_wanted": 3144831050,
"bytes_limit": 3060164198,
"durability": "PERMANENT"
}
],
"type": "circuit_breaking_exception",
"reason": "[parent] Data too large, data for [<http_request>] would be [3144831050/2.9gb], which is larger than the limit of [3060164198/2.8gb], real usage: [3144829848/2.9gb], new bytes reserved: [1202/1.1kb]",
"bytes_wanted": 3144831050,
"bytes_limit": 3060164198,
"durability": "PERMANENT"
},
"status": 429
}

感想:
我很难找出问题的根源。
当使用堆大小 <=8gb 的 ES 集群节点(在 <=16gb vm 上)时,问题变得非常明显,因此,一个明显的解决方案是增加节点的内存。
但我觉得增加内存只能隐藏问题。

问题:
我想了解哪些情况可能导致此错误?
我可以采取什么措施来妥善处理?
(更改断路器值,更改 es.yml 配置,更改/限制我的 ES 请求)

最佳答案

原因是节点的堆已经满了,被断路器捕获是很好的,因为它可以防止节点运行到 OOM 中,变得陈旧和崩溃......

Elasticsearch 6.2.0介绍了断路器并在 7.0.0 中对其进行了改进.随着从 ES-5.4 到 ES-7.2 的版本升级,您将直接体验到这一改进。

到目前为止,我看到了 3 个解决方案:

  • 如果可能,增加堆大小
  • 如果可行,减少批量请求的大小
  • 扩展您的集群,因为分片消耗了大量堆,没有留下任何东西来处理大型请求。更多节点将帮助集群在更多节点之间分配分片和请求,从而导致所有节点上的 AVG 堆使用率较低。

  • 作为一种丑陋的解决方法(不解决问题),可以增加限制 after reading and understanding the implications :

    关于Elasticsearch 7.x 断路器 - 数据过大 - 故障排除,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60075253/

    36 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com