Set jvm parameters for tomcat, zookeeper, activeMQ, and Kafka, and set zookeeperactivemq
1. Set jvm parameters for tomcatSetting method:
Add configuration in the tomcat bin directory:Setenv. sh
#add tomcat pidCATALINA_PID="$CATALINA_BASE/conf/tomcat.pid"#add java optsJAVA_OPTS=" -Djava.awt.headless=true -Djava.net.preferIPv4Stack=true \ -server -Xmx1g -Xms1g -Xmn256m -XX:PermSize=128m -Xss256k -XX:+DisableExplicitGC \ -XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled -XX:+UseCMSCompactAtFullCollection \ -XX:LargePageSizeInBytes=128m -XX:+UseFastAccessorMethods -XX:+UseCMSInitiatingOccupancyOnly \ -XX:CMSInitiatingOccupancyFraction=70"
For parameters, see dubbo configuration.
2. Set jvm parameters for zookeeper
Setting method:
In the zookeeper bin directory, modify
ZkEnv. sh:
Add
SERVER_JVMFLAGSVariable.
ZOOBINDIR="${ZOOBINDIR:-/usr/bin}"ZOOKEEPER_PREFIX="${ZOOBINDIR}/.."SERVER_JVMFLAGS=" -server -Xmx2g -Xms2g -Xmn256m -XX:PermSize=128m -Xss256k -XX:+DisableExplicitGC \ -XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled -XX:+UseCMSCompactAtFullCollection \ -XX:LargePageSizeInBytes=128m -XX:+UseFastAccessorMethods -XX:+UseCMSInitiatingOccupancyOnly \ -XX:CMSInitiatingOccupancyFraction=70 "
For parameters, see dubbo configuration.
3. Set jvm parameters in ActiveMQ.
Setting method:
Modify the ActiveMQ script in the activemq bin directory and set it in the header:
Add the ACTIVEMQ_OPTS_MEMORY variable.
ACTIVEMQ_OPTS_MEMORY=" -server -Xmx5g -Xms5g -Xmn1280m -XX:PermSize=640m -Xss1280k -XX:+DisableExplicitGC \ -XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled -XX:+UseCMSCompactAtFullCollection \ -XX:LargePageSizeInBytes=128m -XX:+UseFastAccessorMethods -XX:+UseCMSInitiatingOccupancyOnly \ -XX:CMSInitiatingOccupancyFraction=70 "
For parameters, see dubbo configuration.
4. Set jvm parameters for kafka
Setting method:
Modify the kafka-server-start.sh file under the Kafka bin directory:
export KAFKA_HEAP_OPTS=" -Xmx5g -Xms5g -Xmn1280m -XX:PermSize=640m -Xss1280k "