elasitic search fresh flush segment merge

new document首先在in memory buffer 中

(1)fresh

触发条件:默认one second 执行一次

执行过程:将memory buffer中documents 写入至filesystem cache(该操作 cheap)形成一个segments,同时写入Translog中(记录操作,相当于灾备),完成写入后打开searcher,清空memory buffer中的document,保证searchable,如此ES 保证了 near realtime search

(2)flush

触发条件:默认30分钟一次或Translog过长时。

执行过程:1、将 memory in buffer中的documents写入segment,打开searcher,清空memory buffer 2、将存于file system中的segment持久化至磁盘中,同时清空Translog  最后构建一个commit point

(3)segment merge

触发条件:太多的small segment,每一个segment都需要一个文件句柄等信息,而且搜索需要in turn 查询每一个segment,所以过多的segment会影响query的速度。

执行过程:1、后台将small segment(包含在disk和file cache中的segment)merge 成 big segment 2、将此 big segment sync disk中 3、建立commit point 打开searcher 4、删除原有的已经合并的的small segments

 

 

what's the systemfile cache: https://msdn.microsoft.com/en-us/library/windows/desktop/aa364218(v=vs.85).aspx

 

posted on 2017-12-06 11:41  zhouzhou0615  阅读(189)  评论(0编辑  收藏  举报

导航