查看原文
其他

RocketMQ解惑篇

2017-12-15 匠心零度 匠心零度
戳上面的蓝字关注我们哦!


转载请注明原创出处,谢谢!

说在前面

依稀记得RocketMQ集群部署配置时候的一些疑惑,今天看到说:Release Notes - Apache RocketMQ - Version 4.2.0可以看出来是前天正式发布的:

下面看看我之前的疑惑:

看到下面这条,激动啊!!!

我去查看RocketMQ4.2.0的配置与之前RocketMQ4.1.0的区别:

通过发现的确把-XX:+DisableExplicitGC参数去掉了,之前疑惑解除了。 比较其他配置还有修改的地方有:

这个修改和我们之前在RocketMQ集群部署配置里面说明是一样的

那么表示之前说的也是对的,还有一次配置进行修改了,就是os.sh

Linux Kernel Parameters

上面提到了os.sh应该还是比较重要的。

看看这些官网的说明:

There is a os.sh script that lists a lot of kernel parameters in folder bin which can be used for >production use with minor changes. Below parameters need attention, and more details >please refer to documentation for /proc/sys/vm/* (详情查看:https://www.kernel.org/doc/Documentation/sysctl/vm.txt)

vm.extra_free_kbytes, tells the VM to keep extra free memory between the threshold where >background reclaim (kswapd) kicks in, and the threshold where direct reclaim (by allocating >processes) kicks in. RocketMQ uses this parameter to avoid high latency in memory allocation.

vm.min_free_kbytes, if you set this to lower than 1024KB, your system will become subtly broken, >and prone to deadlock under high loads.

vm.max_map_count, limits the maximum number of memory map areas a process may have. >RocketMQ will use mmap to load CommitLog and ConsumeQueue, so set a bigger value for this >parameter is recommended.

vm.swappiness, define how aggressive the kernel will swap memory pages. Higher values will >increase agressiveness, lower values decrease the amount of swap. 10 for this value to avoid swap >latency is recommended.

File descriptor limits, RocketMQ needs open file descriptors for files(CommitLog and >ConsumeQueue) and network connections. We recommend set 655350 for file descriptors.

Disk scheduler, the deadline I/O scheduler is recommended for RocketMQ, which attempts to >provide a guaranteed latency for requests(详情查看:https://access.redhat.com/documentation/en-US/RedHatEnterpriseLinux/6/html/PerformanceTuning_Guide/ch06s04s02.html)

执行:

  1. sh os.sh

结果并不怎么完美,还有点错误:

备注:这些错误回头再看看,还有RocketMQ4.2其他新特性,今天只是看这篇解决自己的一些疑惑。

如果读完觉得有收获的话,欢迎点赞、关注、加公众号【匠心零度】。


个人公众号,欢迎关注,查阅更多精彩历史!!!


您可能也对以下帖子感兴趣

文章有问题?点此查看未经处理的缓存