I checked some information during Tomcat performance optimization today. There are two main areas for Tomcat optimization:
1. JVM memory optimization at startup, includingThe number of available JVM of the system, garbage collection efficiency, and thread blocking increase the system response efficiency, highlighted in red.
export JAVA_OPTS="-server -Xms1400M -Xmx1400M -Xss512k -XX:+AggressiveOpts -XX:+UseBiasedLocking -XX:PermSize=128M -XX:MaxPermSize=256M -XX:+DisableExplicitGC -XX:MaxTenuringThreshold=31 -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+CMSParallelRemarkEnabled -XX:+UseCMSCompactAtFullCollection -XX:LargePageSizeInBytes=128m -XX:+UseFastAccessorMethods -XX:+UseCMSInitiatingOccupancyOnly -Djava.awt.headless=true "
The above configuration is under the comment in the first part of the Catalina. Sh file.
I will not explain it for the time being. I will continue to improve it.
2. Tomcat container optimization: the optimization of the main servers. xml configuration file is as follows. The default Tomcat concurrency seems to be 25 or 50, which can be modified.
<Connector port="8080" protocol="HTTP/1.1" URIEncoding="UTF-8" minSpareThreads="25" maxSpareThreads="75" enableLookups="false" disableUploadTimeout="true" connectionTimeout="20000" acceptCount="300" maxThreads="300" maxProcessors="1000" minProcessors="5" useURIValidationHack="false" compression="on" compressionMinSize="2048" compressableMimeType="text/html,text/xml,text/javascript,text/css,text/plain" redirectPort="8443"/>
3. If the study is not completed, the above configurations must be completed after the system configuration is completed.