tomcat server.xml配置调优
2021.01.29
geepair
后端
 热度
℃
记录Tomcat server.xml配置文件的各属性用于调优
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
| <?xml version="1.0" encoding="UTF-8"?>
<Server port="8005" shutdown="SHUTDOWN"> <Listener className="org.apache.catalina.startup.VersionLoggerListener" /> <Listener calssName="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" /> <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" /> <Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" /> <GlobalNamingResources> <Resource name="UserDatabase" auth="Container" type="org.apache.catalina.UserDatabase" description="User database that can be updated and saved" factory="org.apache.catalina.users.MemoryUserDatabaseFactory" pathname="conf/tomcat-users.xml" /> </GlobalNamingResources> <Service name="Catalina"> <Executor name="tomcatThreadPool" namePrefix="catalina-exec-" maxThreads="500" minSpareThreads="80" maxQueueSize="100" maxIdleTime="60000" prestartminSpareThreads="true" /> <Connector port="8080" // 运行的端口 executor="tomcatThreadPool" // 之前定义的线程池 protocol="org.apache.coyote.http11.Http11NioProtocol" //Bio Nio Aio connectionTimeout="20000" redirectPort="8443" maxConnections="10000" enableLookups="false" acceptCount="100" maxPostSize="10485760" maxHttpHeaderSize="4096" compression="on" disableUploadTimeout="true" compressionMinSize="1024" acceptorThreadCount="2" // cpu数量+1 processorCache="20000" tcpNoDelay="true" connectionLinger="5" URIEncoding="utf-8" server="Tengine" compressableMimeType="text/html,text/plain,application/x-javascript,text/css,application/xml,text/javascript,application/x-httpd-php,image/jpeg,image/gif,image/png" /> ... <Engine name="Catalina" defaultHost="localhost"> ... <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/> <Realm className="org.apache.catalina.realm.LockOutRealm"> <Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase"/> </Realm> <Host name="localhost" appBase="webapps" unpackWARS="true" autoDeploy="true"> <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" prefix="localhost_access_log" suffix=".txt" pattern="%h %l %u %t "%r" %s %b" /> </Host> </Engine> </Service> </Server>
|