1、apache-tomcat-7.0.65-windows-x64 server.xml
配置:
<Connector port="8080" protocol="HTTP/1.1" useBodyEncodingForURI="true" URIEncoding="UTF-8" connectionTimeout="20000" redirectPort="8443" />
优化配置:
<!--The connectors can use a shared executor, you can define one or more named thread pools--> <Executor name="tomcatThreadPool" namePrefix="catalina-exec-" maxThreads="1000" minSpareThreads="25"/> <!-- A "Connector" represents an endpoint by which requests are received and responses are returned. Documentation at : Java HTTP Connector: /docs/config/http.html (blocking & non-blocking) Java AJP Connector: /docs/config/ajp.html APR (HTTP/AJP) Connector: /docs/apr.html Define a non-SSL HTTP/1.1 Connector on port 8080 --> <Connector port="8051" protocol="HTTP/1.1" executor="tomcatThreadPool" connectionTimeout="20000" URIEncoding="UTF-8" redirectPort="8443" />
2、启动参数:
export JAVA_OPTS="-Xms2048m -Xmx2048m -Xmn256m -XX:PermSize=128M -XX:MaxNewSize=256m -XX:MaxPermSize=256m -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=50 -XX: CMSFullGCsBeforeCompaction=5 -XX:+UseCMSCompactAtFullCollection -Djava.awt.headless=true -Dfile.encoding=UTF-8 -DappLocation="$APP_LOCATION" -Dtomcat.no=10-crma"