TOMCAT7 Tuning and JVM performance optimization for Linux environments

Source: Internet
Author: User
Tags server memory xms

Label: TOMCAT7 JVM PerformanceShare to:Source: http://www.iteye.com

This optimization is for Linux x86_x64 environments

1. Tomcat optimization is actually optimized for Server.xml (account thread pool, adjust HTTP connector parameters)

Search for "<executor name=" Tomcatthreadpool "", open and adjust to
<executor name= "Tomcatthreadpool" nameprefix= "catalina-exec-"
maxthreads= "Maxidletime=" 60000 "
Minsparethreads= "/>"
Search for "port=" 8080 "", adjusted to
<connector executor= "Tomcatthreadpool"Port=" 8080 "//Open thread pool
Protocol= "ORG.APACHE.COYOTE.HTTP11.Http11aprprotocol"//Open APR protocol, need to install APR support
Maxhttpheadersize= "8192" maxthreads= "processorcache=" "acceptcount=" 1000 "
minsparethreads= "100"
Acceptorthreadcount= "8" uriencoding= "UTF-8"
enablelookups= "false" redirectport= "8443"//Turn off reverse query
connectiontimeout= "120000" keepalivetimeout= "120000"
Maxkeepaliverequests= "65535" disableuploadtimeout= "true"
Compression= "On" compressionminsize= "4096"//Turn on static file compression
nocompressionuseragents= "Gozilla, Traviata"//Turn on static file compression
Compressablemimetype= "Text/html,text/xml,text/javascript,text/css,text/plain,application/json,application/x-javascript"//Turn on static file compression
/>

2. Optimizing the JVM for catalina.sh

Open the Tomcat path \bin\ catalina.sh, add at the top, red part please adjust according to the actual situation
Java_opts= "-server-showversion-xms12g-xmx12g-xx:permsize=256m-xx:maxpermsize=256m "
java_opts= "$JAVA _opts-d64-xx:cicompilercount=8-xx:+usecompressedoops"
java_opts= "$JAVA _opts-xx:survivorratio=4-xx:targetsurvivorratio=90"
java_opts= "$JAVA _opts-xx:reservedcodecachesize=256m-xx:-useadaptivesizepolicy"
java_opts= "$JAVA _opts-duser.timezone=asia/shanghai-xx:-dontcompilehugemethods"
java_opts= "$JAVA _opts-xss256k-xx:+aggressiveopts-xx:+usebiasedlocking"
java_opts= "$JAVA _opts-xx:maxtenuringthreshold=31-xx:+cmsparallelremarkenabled"
java_opts= "$JAVA _opts-xx:+usecmscompactatfullcollection-xx:largepagesizeinbytes=256m-xx:+ Usefastaccessormethods "
java_opts= "$JAVA _opts-xx:+usecmsinitiatingoccupancyonly-djava.awt.headless=true"
java_opts= "$JAVA _opts-xx:+usegcoverheadlimit-xx:allocateprefetchdistance=256-xx:allocateprefetchstyle=1"
java_opts= "$JAVA _opts-xx:+useconcmarksweepgc-xx:+useparnewgc-xx:maxgcpausemillis=200"
Note
1.-xms=-xmx= server memory *70%, such as deploying Tomcat,jboss-xms=-xmx= server memory on the same server *80%*1/4

2. Added parameter suggestions to understand what it means, you can refer to the JVM parameter list

TOMCAT7 Tuning and JVM performance optimization for Linux environments

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.