RocketMQ memory tuning

A, RocketMQ tuning memory

Background Tuning 1.1 RocketMQ

RocketMQ default memory usage is very high, a 4 × 4g, a configuration that generally need to be adjusted.

1.2 RocketMQ adjustment program memory

  1. MQ adjustment startup script
  2. Adjustment mqnamesrv and mqbroker profile

1.2.1 adjustment MQ startup script

1. Adjust runbroker.sh and runserver.sh script

JAVA_OPT="${JAVA_OPT} -server -Xms256m -Xmx1g -Xmn256m -XX:PermSize=128m -XX:MaxPermSize=320m"

The above configuration can be adjusted according to their own situation, remember runbroker.sh be modified and runserver.sh

1.2.2 adjustment mqbroker and mqnamesrv profile

1. Adjust mqbroker.xml and mqnamesrv.xml profile

<options>
      <-Xms512m></-Xms512m>
      <-Xmx1g></-Xmx1g>
      <-XX:NewSize>256M</-XX:NewSize>
      <-XX:MaxNewSize>512M</-XX:MaxNewSize>
      <-XX:PermSize>128M</-XX:PermSize>
      <-XX:MaxPermSize>128M</-XX:MaxPermSize>
</options>

The machine can be configured according to the above situation, remember mqbroker.xml be modified and mqnamesrv.xml

Thing to note is that mqbroker.xml and mqnamesrv.xml memory should not exceed runbroker.sh and runserver.sh memory, otherwise it will lead to not enough memory crash.

Published 161 original articles · won praise 40 · views 120 000 +

Guess you like

Origin blog.csdn.net/qq_36441027/article/details/101215414