Tomcat启动优化配置

 

# set juli

if [ -r "$CATALINA_HOME"/bin/tomcat-juli.jar ]; then

 

   ### SuSE9-Linux

   v_num=`uname -r| grep '2.6.5'|wc -l`

   v_num=`echo ${v_num}`

   if [ "-${v_num}" = "-1" ] ; then

      JAVA_OPTS="$JAVA_OPTS "-server" "-XX:+UseParallelGC" "-XX:ParallelGCThreads=8" "-XX:NewRatio=16" "-XX:+UseAdaptiveSizePolicy

      JAVA_OPTS="$JAVA_OPTS "-Xms1024m" "-Xmx1024m" "-XX:PermSize=128m" "-XX:MaxPermSize=256m" "-Djava.net.preferIPv4Stack=true

      # gc log

      #JAVA_OPTS="$JAVA_OPTS "-Xloggc:gc.txt

   fi

 

   ### SuSE10-Linux

   v_num=`uname -r| grep '2.6.16'|wc -l`

   v_num=`echo ${v_num}`

   if [ "-${v_num}" = "-1" ] ; then

      JAVA_OPTS="$JAVA_OPTS "-server" "-XX:+UseParallelGC" "-XX:ParallelGCThreads=8" "-XX:NewRatio=16" "-XX:+UseAdaptiveSizePolicy

      JAVA_OPTS="$JAVA_OPTS "-Xms4096m" "-Xmx4096m" "-XX:PermSize=128m" "-XX:MaxPermSize=384m" "-Djava.net.preferIPv4Stack=true

      JAVA_OPTS="$JAVA_OPTS "-Xmn2048m      

      #JAVA_OPTS="$JAVA_OPTS "-Xloggc:gc.txt

 

   fi

 

   ### HP-UX

   if [ "-${OSType}" = "-HP-UX" ] ; then

       JAVA_OPTS="$JAVA_OPTS "-d64

   fi

 

   ### AIX

   if [ "-${OSType}" = "-AIX" ] ; then

      JAVA_OPTS="$JAVA_OPTS "-Xargencoding:utf8"  "-Xms1024m" "-Xmx1024m"  "-Xmn512m" "-Djava.net.preferIPv4Stack=true

      JAVA_OPTS="$JAVA_OPTS "-Dibm.stream.nio=true" "-Dcom.ibm.cacheLocalHost=true

      JAVA_OPTS="$JAVA_OPTS "-Xgcpolicy:gencon" "-Xconcurrentbackground4" "-Xconcurrentlevel2

      # gc log

      #JAVA_OPTS="$JAVA_OPTS "-verbose:gc" "-Xverbosegclog:gc.txt

      #JAVA_OPTS="$JAVA_OPTS "-Xdump:heap

 

      # 2008-11-20 zhuhaibo 

      JAVA_OPTS="$JAVA_OPTS "-Dfile.encoding=GB2312

   fi 

 

  JAVA_OPTS="$JAVA_OPTS "-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager

  JAVA_OPTS="$JAVA_OPTS "-Djava.util.logging.config.file=$CATALINA_BASE/conf/logging.properties

  JAVA_OPTS="$JAVA_OPTS "-Dplat.deep=true

 

 

fi

 

 

 

# ----- Execute The Requested Command -----------------------------------------

你可能感兴趣的:(tomcat,linux)