Filebeat 同步写位点文件引发的磁盘 IO 问题
使用 Filebeat 版本 6.8.9(高版本也涉及)
通过监控发现宿主机磁盘繁忙


发现 filebeat 进程和 jdb2 进程占据了磁盘 IO 的大部分(97%+)。
经研究发现 filebeat 写临时位点文件代码中采用了 direct IO 的写方式。
diskstore.go checkpointTmpFile 方法:
复制代码
考虑到 checkpointTmpFile 应该无需同步刷盘(最坏情况可能重复采集),故去掉 os.O_SYNC
更新后效果明显:

磁盘繁忙前后对照(另外一台)


给 filebeat 提了 mr,还没合并。https://github.com/elastic/beats/pull/23325
版权声明: 本文为 InfoQ 作者【秦宝齐】的原创文章。
原文链接:【http://xie.infoq.cn/article/06bfae6a24c8a8b3ce439ea87】。文章转载请联系作者。
评论