gpt4 book ai didi

elasticsearch - ElasticSearch何时执行刷新

转载 作者:行者123 更新时间:2023-12-02 23:09:15 27 4
gpt4 key购买 nike

在什么条件下触发ElasticSearch节点/索引/碎片中的刷新?

关于ElasticSearch每秒刷新一次并以不太频繁的方式进行刷新以避免频繁使用CPU的流程有很好的解释,但是哪个组件负责执行刷新?

我试图查看源代码,但没有找到正确的地方。

最佳答案

没有固定的时间间隔,Elasticsearch使用一些启发式方法来确定何时调用flush作为mentioned in the official doc

Elasticsearch automatically triggers flushes as needed, using heuristics that trade off the size of the unflushed transaction log against the cost of performing each flush.



就像Elastic团队成员 at the end of this SO answer中解释的那样,这种启发式取决于

depending on how many operations get added to the transaction log, how big they are, and when the last flush happened.



注意:您也可以调整冲洗操作的设置,但不建议这样做。

编辑: https://github.com/elastic/elasticsearch/blob/master/server/src/main/java/org/elasticsearch/action/bulk/BulkProcessor.java#L48是处理刷新操作的源代码。

关于elasticsearch - ElasticSearch何时执行刷新,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62087059/

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