怎么又是你

forcemerge产生的大segment为什么不能再继续写入呢, 官方文档这一段不太明白

Elasticsearch | 作者 yuechen323 | 发布于2021年07月01日 | 阅读数:1456

3w.elastic.co/guide/en/elasticsearch/reference/7.13/tune-for-disk-usage.html
内容如下:
Force merge should only be called against an index after you have finished writing to it. Force merge can cause very large (>5GB) segments to be produced, and if you continue to write to such an index then the automatic merge policy will never consider these segments for future merges until they mostly consist of deleted documents. This can cause very large segments to remain in the index which can result in increased disk usage and worse search performance.

他说, 如果继续写入会造成永远不会合并, 知道他们主要由已经删除的文档组成

1. 为啥不合并呢?
2. 百分之多少是删除的才合并呢?
已邀请:

Charele - Cisco4321

赞同来自: yuechen323

ES(或者说Lucene)在merge时,大段是不会参与合并的,
可能是了为不让段变成巨大无比,而影响性能吧。太小不好(太小了数量就会多),太大也不好。
在如何定义大段时,除了大于2.5G这个条件外,还有就是删除操作比例不大于1/3.
 
打个比方,就像航空公司不允许超过250斤的胖子上机(因为太重了,飞机承重不了),
但如果他体内有超过1/3的水分,就允许上机(因为排掉水,就变轻了)
 
还是事实说话吧:

QQ图片20210701131707.png

上面是两个条件,
下面兰色的就是去掉这个段,即不参与merge

要回复问题请先登录注册