Tomcat performance tuning makes the kitten fly happily.

Source: Internet
Author: User

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.

 


 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.