1. Specify the path and VM parameter configuration using JDK
To modify Catalina.bat in the bin file, add the following to approximately 95 rows of setlocal:
Set java_opts=-xms256m-xmx512m-xx:permsize=256m-xx:maxpermsize=512m//configuration VM parameters, according to the actual system configuration
Set java_home=...\jdk1.8.0_92//Specify the appropriate version of the JDK path
Set Jre_home=...\jdk1.8.0_92\jre
2. Modify Link Parameters
Modify the Server.xml under the Conf path to
<!-- <executor name= "Tomcatthreadpool" nameprefix= catalina-exec-"maxthreads=" minsparethreads= " 4"/ >
Revision changed to
< Executor name = "Tomcatthreadpool" nameprefix= "catalina-exec-" maxthreads= " number"//MAX concurrency, The default setting of 200, generally recommended in 500 ~ 800, according to the hardware facilities and business to judge minsparethreads= " //tomcat" Number of threads created at initialization, default = "true"//minsparethreads parameter values are initialized at Tomcat initialization, if not equal to true, The value of Minsparethreads is invalid = "100"//maximum number of waiting queues, and the request is rejected />
Modify the default link parameter configuration to
< Connector Port = "8080" protocol= "http/1.1" connectiontimeout= "20000" Redirectport= "8443"/>
Revision changed to
<ConnectorExecutor= "Tomcatthreadpool"Port= "8080"Protocol= "Org.apache.coyote.http11.Http11Nio2Protocol" //tomcat 8 settings Nio2 better, Tomcat 6, 7 set NiO better: Org.apache.coyote.http11.Http11NioProtocol connectiontimeout = "20000"MaxConnections= "10000"Redirectport= "8443"enablelookups= "false" //Disable DNS query acceptcount= "+" //Specifies the number of requests that can be placed into the processing queue when all the threads that can be used to process the request are used, and requests that exceed this number will not be processed, the default setting is Maxpostsize= "10485760" //In the form URL parameter mode of the POST submission method, limit the maximum size of the commit, the default is 2097152 (2 trillion), it uses the unit is bytes. 10485760 is 10M. If you want to disable throttling, you can set it to-1. Compression= "On"Disableuploadtimeout= "true"compressionminsize= "2048"Acceptorthreadcount= "2" //The number of threads used to receive connections, the default value is 1. Generally this refers to the need to change the time is because the server is a multi-core CPU, if the multi-core CPU is generally configured to 2. Compressablemimetype= "Text/html,text/xml,text/plain,text/css,text/javascript,application/javascript"uriencoding= "Utf-8"/>
About the optimization of Tomcat 8 (under Windows)