A. Memory
Note:
The persistence state (storing constant, static variable area) configuration of-xx:permsize and-xx:maxpermsize is discarded in jdk1.8,
More than one metadata area (Metadata Space: Default is 0.2% of memory): So the parameter that sets the size of the metadata area also becomes corresponding metaspacesize and maxmetaspacesize.
Set java_opts=-server-xms2048m-xmx2048m-xss2m -xx:metaspacesize=256m -xx:maxnewsize=1024m
After you turn on Tomcat, use JPS to view the port occupancy:
Bootstrap is the Tomcat process number
Then use jmap-heap 20372 to view details
The display proves that the configuration was successful. Note: The JPS and JMAP commands must be configured with Java environment variables.
2. Configuration optimizations (concurrency)
Open the Tomcat installation directory \conf\server.xml file and navigate to this line:
<connector connectiontimeout= "20000" port= "8080" protocol= "http/1.1" redirectport= "8443"/>
This line is where our Tomcat container performance parameters are set, and it will generally have a default value that is far from being used by us, and we look at the configuration of this section after the change:
<ConnectorPort= "8080"Protocol= "http/1.1"MaxThreads= "+"minsparethreads= "+"Acceptcount= "+"MaxConnections= "+"ConnectionTimeout= "20000"maxhttpheadersize= "8192"Tcpnodelay= "true"Compression= "On"compressionminsize= "2048"Disableuploadtimeout= "true"Redirectport= "8443"enablelookups= "false"uriencoding= "UTF-8" />
Configure the thread pool: Configure before connector under service tag
<!--thread pool-- <executor name= "Tomcatthreadpool" nameprefix= "catalina-exec-" maxthreads= "1000" minsparethreads= "maxidletime=" 60000 " maxqueuesize=" Integer.max_value " Prestartminsparethreads= "false" threadpriority= "5" classname= " Org.apache.catalina.core.StandardThreadExecutor "/>
After the thread pool configuration is complete, refer to in connector:
<connector executor= "Tomcatthreadpool" ...
Reference Blog: http://blog.csdn.net/qq525099302/article/details/78396120
Https://www.cnblogs.com/redcreen/archive/2011/05/04/2037057.html
http://blog.csdn.net/u012562943/article/details/51441157
http://blog.csdn.net/wangyonglin1123/article/details/50986524
(under Windows) Tomcat optimization--memory, concurrency. Three aspects of cache optimization