rocketmq-docker
rocketmq-docker copied to clipboard
Run two or more rockermq container in a host set the max heap size.
well,when we used docker to run rocketmq two or more container in a host,we found that the max heap size can‘t limited by cgroups. so, why it happened?
we found taht max heap size set by https://github.com/apache/rocketmq-docker/blob/master/image-build/scripts/runbroker-customize.sh the script. In this script , linux set max heap size by "free -m" to calculate.But "free -m" will read host /proc/meminfo,it not cgroups limited. we found lxcfs can make it . when you install lxcfs and run it 。 then you run docker run -it --name my_rocketmq -memory=8g -v /var/lib/lxcfs/proc/meminfo:/proc/meminfo:rw apache/rocketmq:4.7.1 and then you wiil found that “free -m” is 8g