apache / rocketmq

Apache RocketMQ is a cloud native messaging and streaming platform, making it simple to build event-driven applications.
https://rocketmq.apache.org/
Apache License 2.0
21.19k stars 11.67k forks source link

warmMapedFileEnable maybe cause the slave node oom to be killed #6209

Closed makabakaboom closed 7 months ago

makabakaboom commented 1 year ago

warmMapedFileEnable 开启后会提前触发缺页建立文件内存页和文件的实际映射,并调用mlock将这部分内存页锁定不被换出。Master写入时,在文件写完切换时,会调用munlock标记可以释放,但是Slave节点并不会触发munlock逻辑,导致一段时间就会被内核OOM 给Kill掉,所以warmMapedFileEnable需要在Slave节点不允许开启

RongtongJin commented 1 year ago

munlock

Good catch! Could you subbmit a pull request to fix the issue?

lizhimins commented 1 year ago

在 ha 同步时,可以使用 dio 来优化下写入,优化备机的内存使用

makabakaboom commented 1 year ago

在 ha 同步时,可以使用 dio 来优化下写入,优化备机的内存使用

目前版本有实现dio来实现优化写入么,代码里面还没有看到。不过备机在大部分时间不会作为读取情况,可以使用但是优化空间不大。如果在多Container情况下,有其它master节点的副本同步情况下,使用dio来优化,减少内存页竞争是个不错的想法

github-actions[bot] commented 8 months ago

This issue is stale because it has been open for 365 days with no activity. It will be closed in 3 days if no further activity occurs.

github-actions[bot] commented 7 months ago

This issue was closed because it has been inactive for 3 days since being marked as stale.