############################################### tomcatnum=`ps -ef|grep ‘bin/catalina.sh‘|egrep -v grep |wc -l` mem=`free -g|awk ‘/Mem/{print $2}‘` echo $mem $tomcatnum a=`expr $mem / $tomcatnum + 1` echo $a $a是几。jvm就设置几G ############################################################ ps -ef|grep ‘bin/catalina.sh‘|egrep -v grep cp catalina.sh catalina.sh.`date +%F` cp catalina.sh catalina.sh.`date +%F` \cp 8catalina.sh8 catalina.sh ls catalina.sh* cp catalina.sh catalina.sh.`date +%F` \cp 4catalina.sh4 catalina.sh ls catalina.sh* cp catalina.sh catalina.sh.`date +%F` \cp 2catalina.sh2 catalina.sh ls catalina.sh* ############################################################ ps -ef|grep `pwd|awk -F‘/‘ ‘{print $(NF-1)}‘` ps -ef|grep `pwd|awk -F‘/‘ ‘{print $(NF-1)}‘`|awk ‘{print $2}‘ |xargs kill -9 /etc/init.d/`pwd|awk -F‘/‘ ‘{print $(NF-1)}‘` start ps -ef|grep `pwd|awk -F‘/‘ ‘{print $(NF-1)}‘` /wdzj/java/admin_tomcat/bin/ cp catalina.sh catalina.sh.`date +%F` ls catalina.sh* Jvm优化参考 8G: JAVA_OPTS=‘-Xms4096m -Xmx4096m -XX:PermSize=512M -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC‘ 4G: JAVA_OPTS=‘-Xms2048m -Xmx2048m -XX:PermSize=256M -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC‘ 2G: JAVA_OPTS=‘-Xms1024m -Xmx1024m -XX:PermSize=128M -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC‘
本文出自 “奋斗吧” 博客,请务必保留此出处http://lvnian.blog.51cto.com/7155281/1889748
原文地址:http://lvnian.blog.51cto.com/7155281/1889748