server.xml 优化配置
<Connector port="8080" protocol="HTTP/1.1" URIEncoding="UTF-8" minSpareThreads="25" maxSpareThreads="75" connectionTimeout="20000" enableLookups="false" disableUploadTimeout="true" acceptCount="400" maxThreads="500" maxProcessors="1000" minProcessors="5" useURIValidationHack="false" compression="on" compressionMinSize="2048" compressableMimeType="text/html,text/xml,text/javascript,text/css,text/plain" redirectPort="8443" />
catalina.sh优化配置
JAVA_OPTS="-Djava.awt.headless=true -Dfile.encoding=UTF-8 -server -Xms1024m -Xmx1024m -XX:NewSize=512m -XX:MaxNewSize=512m -XX:PermSize=512m -XX:MaxPermSize=512m"
启动脚本
#!/bin/bash # Description:tomcat ORS SERVER # chkconfig: - 85 15 TOMCAT_HOME="/opt/wcc/apache-tomcat-8.5.24" TOMCAT_STOP=$TOMCAT_HOME/bin/shutdown.sh TOMCAT_START=$TOMCAT_HOME/bin/startup.sh PID=$(jps|grep -w "Bootstrap"|awk '{print $1}') export CATALINA_HOME=$TOMCAT_HOME export JAVA_HOME=/usr/java/default TOMCAT_USER=ops case $1 in start) echo -n "Starting tomcat..." /bin/su - $TOMCAT_USER -s /bin/bash -c $TOMCAT_START echo " done" ;; stop) echo -n "Stoping tomcat..." /bin/su - $TOMCAT_USER -s /bin/bash -c $TOMCAT_STOP echo " done" ;; restart) $0 stop $0 start ;; status) if [ -z "$PID" ];then echo "tomcat is not running!" else echo "tomcat is running!" fi ;; *) echo "Usage: $0" exit 1 esac