RocektMQ JVM参数
Broker
/bin/java
-server
-Xms1024m
-Xmx1024m
-Xmn256m
-XX:+UseG1GC
-XX:G1HeapRegionSize=16m
-XX:G1ReservePercent=25
-XX:InitiatingHeapOccupancyPercent=30
-XX:SoftRefLRUPolicyMSPerMB=0 在有大量反射代码的场景下,该值要大于0,默认是1000
-verbose:gc
-Xloggc:/dev/shm/mq_gc_%p.log
-XX:+PrintGCDetails
-XX:+PrintGCDateStamps
-XX:+PrintGCApplicationStoppedTime
-XX:+PrintAdaptiveSizePolicy
-XX:+UseGCLogFileRotation
-XX:NumberOfGCLogFiles=5
-XX:GCLogFileSize=30m
-XX:-OmitStackTraceInFastThrow 不打印异常栈信息,不利于调试
-XX:-UseLargePages
-XX:+AlwaysPreTouch 真正分配物理内存
-XX:MaxDirectMemorySize=2g
-XX:-UseBiasedLocking
-Djava.ext.dirs=/jre/lib/ext:/mnt/rocketmq-4.5.1/bin/../lib
-cp .:/mnt/rocketmq-4.5.1/bin/../conf:
org.apache.rocketmq.broker.BrokerStartup
Name Server
/bin/java
-server
-Xms1024m
-Xmx1024m
-Xmn256m
-XX:MetaspaceSize=64m
-XX:MaxMetaspaceSize=128m
-XX:+UseConcMarkSweepGC
-XX:+UseCMSCompactAtFullCollection
-XX:CMSInitiatingOccupancyFraction=70
-XX:+CMSParallelRemarkEnabled
-XX:+CMSClassUnloadingEnabled
-XX:SurvivorRatio=8
-XX:-UseParNewGC
-XX:SoftRefLRUPolicyMSPerMB=0
-verbose:gc
-Xloggc:/dev/shm/rmq_srv_gc.log
-XX:+PrintGCDetails
-XX:-OmitStackTraceInFastThrow
-XX:-UseLargePages
-Djava.ext.dirs=/jre/lib/ext:/mnt/rocketmq-4.5.1/bin/../lib
-cp .:/mnt/rocketmq-4.5.1/bin/../conf:
org.apache.rocketmq.namesrv.NamesrvStartup
谢谢阅读!