Hi Christopher, PFA, the requested XMLs. Just want to highlight that tomcat 8 is not able to use the CPU usage. I have tried maxThread 200,300,400 but result is same sometimes even less TPS. Regards, Ravi
-----Original Message----- From: Christopher Schultz [mailto:ch...@christopherschultz.net] Sent: Tuesday, April 19, 2016 7:38 PM To: Tomcat Users List Subject: Re: performance of tomcat 8 is less than tomcat 6 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Ravi, On 4/19/16 1:04 AM, Ravi Chandra Suryavanshi wrote: > Hi, I am using tomcat 6 in my product. I am planning to upgrade to > tomcat 8 as tomcat is going to EoS in Dec-2016. I have just taken the > performance of Tomcat 8 and found the 70% less performance compared to > tomcat 6. See the below results Tomcat 6 is giving 167473.2/s whereas > tomcat 8 is giving 100436.6/s I have just compared with two standalone > tomcat which is just hitting the HelloWorld servlet available in > example. > > Kindly let me know what need to configure to boost the performance. > > Following are my setup: Java=Java 8 HttpClient=HttpClient4 Benchmark > tool=jmeter > > testserver:~# uname -a Linux testserver 3.10.0-229.el7.x86_64 #1 SMP > Thu Jan 29 18:37:38 EST 2015 x86_64 x86_64 x86_64 GNU/Linux > > > > testserver:~# lscpu Architecture: x86_64 CPU op-mode(s): > 32-bit, 64-bit Byte Order: Little Endian CPU(s): > 32 On-line CPU(s) list: 0-31 Thread(s) per core: 2 Core(s) per > socket: 8 Socket(s): 2 NUMA node(s): 2 > Vendor ID: GenuineIntel CPU family: 6 Model: > 63 Model name: Intel(R) Xeon(R) CPU E5-2640 v3 @ > 2.60GHz Stepping: 2 CPU MHz: 2600.000 > BogoMIPS: 5210.53 Virtualization: VT-x L1d > cache: 32K L1i cache: 32K L2 cache: > 256K L3 cache: 20480K NUMA node0 CPU(s): > 0-7,16-23 NUMA node1 CPU(s): 8-15,24-31 > > testserver:~# vmstat -s 131730840 K total memory 5931052 K used memory > 7126352 K active memory 5511616 K inactive memory 116069376 K free > memory 20888 K buffer memory 9709520 K swap cache 11681788 K total > swap 0 K used swap 11681788 K free swap 54069797 non-nice user cpu > ticks 997 nice user cpu ticks 9712353 system cpu ticks > 15112937897 idle cpu ticks 37101 IO-wait cpu ticks 73 IRQ cpu ticks > 21245 softirq cpu ticks 0 stolen cpu ticks 8918100 pages paged in > 267868897 pages paged out 0 pages swapped in 0 pages swapped out > 4281536287 interrupts 4185543972 CPU context switches > 1456296771 boot time 84815522 forks > > > > Tomcat 6 performance > > Linux 3.10.0-229.el7.x86_64 (testserver) 04/19/2016 > _x86_64_ (32 CPU) 05:36:33 PM CPU %user %nice > %system %iowait %steal %idle 05:36:38 PM all 37.66 > 0.00 14.69 0.10 0.00 47.55 05:36:43 PM all > 37.61 0.00 14.50 0.01 0.00 47.89 05:36:48 PM > all 38.31 0.00 14.48 0.03 0.00 47.19 > 05:36:53 PM all 37.45 0.00 14.53 0.01 > 0.00 48.01 05:36:58 PM all 37.97 0.00 14.67 > 0.02 0.00 47.34 05:37:03 PM all 37.68 0.00 > 14.62 0.01 0.00 47.69 > > Created the tree successfully using HTTPRequest.jmx Starting the test > @ Wed Apr 13 17:34:58 CEST 2016 (1460561698701) Waiting for > possible shutdown message on port 4445 summary + 16181 in 1.3s = > 12893.2/s Avg: 0 Min: 0 Max: 67 Err: 0 (0.00%) > Active: 3 Started: 3 Finished: 0 summary + 5187350 in 30s = > 172911.7/s Avg: 0 Min: 0 Max: 31 Err: 0 (0.00%) > Active: 24 Started: 24 Finished: 0 summary = 5203531 in 31.3s = > 166486.4/s Avg: 0 Min: 0 Max: 67 Err: 0 (0.00%) > summary + 5207210 in 30s = 173573.7/s Avg: 0 Min: 0 Max: > 26 Err: 0 (0.00%) Active: 24 Started: 24 Finished: 0 summary = > 10410741 in 61.3s = 169957.4/s Avg: 0 Min: 0 Max: 67 > Err: 0 (0.00%) summary + 5039715 in 30s = 167990.5/s Avg: > 0 Min: 0 Max: 13 Err: 0 (0.00%) Active: 24 Started: 24 > Finished: 0 summary = 15450456 in 91.3s = 169310.8/s Avg: 0 > Min: 0 Max: 67 Err: 0 (0.00%) summary + 5024196 in > 30s = 167473.2/s Avg: 0 Min: 0 Max: 22 Err: 0 > (0.00%) Active: 24 Started: 24 Finished: 0 summary = 20474652 in > 121s = 168856.1/s Avg: 0 Min: 0 Max: 67 Err: 0 > (0.00%) > > > ---------------------------------------------------------------------- - ------------------------------------------------------------------------ - ---------------- > > tomcat 8 > > Linux 3.10.0-229.el7.x86_64 (testserver) 04/19/2016 > _x86_64_ (32 CPU) > > 06:14:36 PM CPU %user %nice %system %iowait > %steal %idle 06:14:41 PM all 24.10 0.00 9.39 > 0.01 0.00 66.51 06:14:46 PM all 24.62 0.00 > 9.25 0.00 0.00 66.13 06:14:51 PM all 24.66 > 0.00 9.12 0.01 0.00 66.22 06:14:56 PM all > 23.96 0.00 9.36 0.08 0.00 66.60 06:15:01 PM > all 24.78 0.00 9.52 0.01 0.00 65.69 > 06:15:06 PM all 23.86 0.00 9.24 0.03 > 0.00 66.87 > > > > > > Created the tree successfully using HTTPRequest.jmx Starting the test > @ Wed Apr 13 18:12:41 CEST 2016 (1460563961583) Waiting for possible > shutdown message on port 4445 summary + 1600892 in 18.4s > = 87104.4/s Avg: 0 Min: 0 Max: 1040 Err: 0 (0.00%) > Active: 24 Started: 24 Finished: 0 summary + 3102671 in 30s = > 103422.4/s Avg: 0 Min: 0 Max: 9 Err: 0 (0.00%) > Active: 24 Started: 24 Finished: 0 summary = 4703563 in 48.4s = > 97223.2/s Avg: 0 Min: 0 Max: 1040 Err: 0 (0.00%) > summary + 3090174 in 30s = 103005.8/s Avg: 0 Min: 0 Max: > 9 Err: 0 (0.00%) Active: 24 Started: 24 Finished: 0 summary = > 7793737 in 78.4s = 99436.5/s Avg: 0 Min: 0 Max: 1040 Err: > 0 (0.00%) summary + 3091476 in 30s = 103049.2/s Avg: 0 Min: > 0 Max: 10 Err: 0 (0.00%) Active: 24 Started: 24 Finished: 0 > summary = 10885213 in 108s = 100436.6/s Avg: 0 Min: 0 > Max: 1040 Err: 0 (0.00%) > > Regards, Ravi > > Can you post your server.xml configurations for each of Tomcat 6 and Tomcat 8? - -chris -----BEGIN PGP SIGNATURE----- Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iEYEARECAAYFAlcWO90ACgkQ9CaO5/Lv0PBI+wCZAVSg1v3GulO2x8Uv5f6dWcfj FwMAoMMK6pwvZuwUckXM1sW/p2y1IhHd =Rj7o -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
<?xml version='1.0' encoding='utf-8'?> <!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <!-- Note: A "Server" is not itself a "Container", so you may not define subcomponents such as "Valves" at this level. Documentation at /docs/config/server.html --> <Server port="8005" shutdown="SHUTDOWN"> <!--APR library loader. Documentation at /docs/apr.html --> <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" /> <!--Initialize Jasper prior to webapps are loaded. Documentation at /docs/jasper-howto.html --> <Listener className="org.apache.catalina.core.JasperListener" /> <!-- Prevent memory leaks due to use of particular java/javax APIs--> <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" /> <!-- JMX Support for the Tomcat server. Documentation at /docs/non-existent.html --> <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener" /> <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" /> <!-- Global JNDI resources Documentation at /docs/jndi-resources-howto.html --> <GlobalNamingResources> <!-- Editable user database that can also be used by UserDatabaseRealm to authenticate users --> <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> <!-- A "Service" is a collection of one or more "Connectors" that share a single "Container" Note: A "Service" is not itself a "Container", so you may not define subcomponents such as "Valves" at this level. Documentation at /docs/config/service.html --> <Service name="Catalina"> <!--The connectors can use a shared executor, you can define one or more named thread pools--> <!-- <Executor name="tomcatThreadPool" namePrefix="catalina-exec-" maxThreads="150" minSpareThreads="4"/> --> <!-- A "Connector" represents an endpoint by which requests are received and responses are returned. Documentation at : Java HTTP Connector: /docs/config/http.html (blocking & non-blocking) Java AJP Connector: /docs/config/ajp.html APR (HTTP/AJP) Connector: /docs/apr.html Define a non-SSL HTTP/1.1 Connector on port 8080 --> <Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" /> <!-- A "Connector" using the shared thread pool--> <!-- <Connector executor="tomcatThreadPool" port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" /> --> <!-- Define a SSL HTTP/1.1 Connector on port 8443 This connector uses the JSSE configuration, when using APR, the connector should be using the OpenSSL style configuration described in the APR documentation --> <!-- <Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true" maxThreads="150" scheme="https" secure="true" clientAuth="false" sslProtocol="TLS" /> --> <!-- Define an AJP 1.3 Connector on port 8009 --> <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" /> <!-- An Engine represents the entry point (within Catalina) that processes every request. The Engine implementation for Tomcat stand alone analyzes the HTTP headers included with the request, and passes them on to the appropriate Host (virtual host). Documentation at /docs/config/engine.html --> <!-- You should set jvmRoute to support load-balancing via AJP ie : <Engine name="Catalina" defaultHost="localhost" jvmRoute="jvm1"> --> <Engine name="Catalina" defaultHost="localhost"> <!--For clustering, please take a look at documentation at: /docs/cluster-howto.html (simple how to) /docs/config/cluster.html (reference documentation) --> <!-- <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/> --> <!-- The request dumper valve dumps useful debugging information about the request and response data received and sent by Tomcat. Documentation at: /docs/config/valve.html --> <!-- <Valve className="org.apache.catalina.valves.RequestDumperValve"/> --> <!-- This Realm uses the UserDatabase configured in the global JNDI resources under the key "UserDatabase". Any edits that are performed against this UserDatabase are immediately available for use by the Realm. --> <Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase"/> <!-- Define the default virtual host Note: XML Schema validation will not work with Xerces 2.2. --> <Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false"> <!-- SingleSignOn valve, share authentication between web applications Documentation at: /docs/config/valve.html --> <!-- <Valve className="org.apache.catalina.authenticator.SingleSignOn" /> --> <!-- Access log processes all example. Documentation at: /docs/config/valve.html --> <!-- <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" prefix="localhost_access_log." suffix=".txt" pattern="common" resolveHosts="false"/> --> </Host> </Engine> </Service> </Server>
<?xml version='1.0' encoding='utf-8'?> <!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <!-- Note: A "Server" is not itself a "Container", so you may not define subcomponents such as "Valves" at this level. Documentation at /docs/config/server.html --> <Server port="8005" shutdown="SHUTDOWN"> <Listener className="org.apache.catalina.startup.VersionLoggerListener" /> <!-- Security listener. Documentation at /docs/config/listeners.html <Listener className="org.apache.catalina.security.SecurityListener" /> --> <!--APR library loader. Documentation at /docs/apr.html --> <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" /> <!-- Prevent memory leaks due to use of particular java/javax APIs--> <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" /> <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" /> <Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" /> <!-- Global JNDI resources Documentation at /docs/jndi-resources-howto.html --> <GlobalNamingResources> <!-- Editable user database that can also be used by UserDatabaseRealm to authenticate users --> <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> <!-- A "Service" is a collection of one or more "Connectors" that share a single "Container" Note: A "Service" is not itself a "Container", so you may not define subcomponents such as "Valves" at this level. Documentation at /docs/config/service.html --> <Service name="Catalina"> <!--The connectors can use a shared executor, you can define one or more named thread pools--> <!-- --> <Executor name="tomcatThreadPool" namePrefix="catalina-exec-" maxThreads="150" minSpareThreads="4"/> <!-- A "Connector" represents an endpoint by which requests are received and responses are returned. Documentation at : Java HTTP Connector: /docs/config/http.html (blocking & non-blocking) Java AJP Connector: /docs/config/ajp.html APR (HTTP/AJP) Connector: /docs/apr.html Define a non-SSL/TLS HTTP/1.1 Connector on port 8080 --> <!-- <Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" /> --> <!-- A "Connector" using the shared thread pool--> <Connector executor="tomcatThreadPool" protocol="org.apache.coyote.http11.Http11Nio2Protocol" acceptorThreadCount="1" port="8080" connectionTimeout="20000" redirectPort="8443" /> <!-- Define a SSL/TLS HTTP/1.1 Connector on port 8443 This connector uses the NIO implementation that requires the JSSE style configuration. When using the APR/native implementation, the OpenSSL style configuration is required as described in the APR/native documentation --> <!-- <Connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol" maxThreads="150" SSLEnabled="true" scheme="https" secure="true" clientAuth="false" sslProtocol="TLS" /> --> <!-- Define an AJP 1.3 Connector on port 8009 --> <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" /> <!-- An Engine represents the entry point (within Catalina) that processes every request. The Engine implementation for Tomcat stand alone analyzes the HTTP headers included with the request, and passes them on to the appropriate Host (virtual host). Documentation at /docs/config/engine.html --> <!-- You should set jvmRoute to support load-balancing via AJP ie : <Engine name="Catalina" defaultHost="localhost" jvmRoute="jvm1"> --> <Engine name="Catalina" defaultHost="localhost"> <!--For clustering, please take a look at documentation at: /docs/cluster-howto.html (simple how to) /docs/config/cluster.html (reference documentation) --> <!-- <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/> --> <!-- Use the LockOutRealm to prevent attempts to guess user passwords via a brute-force attack --> <Realm className="org.apache.catalina.realm.LockOutRealm"> <!-- This Realm uses the UserDatabase configured in the global JNDI resources under the key "UserDatabase". Any edits that are performed against this UserDatabase are immediately available for use by the Realm. --> <Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase"/> </Realm> <Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="true"> <!-- SingleSignOn valve, share authentication between web applications Documentation at: /docs/config/valve.html --> <!-- <Valve className="org.apache.catalina.authenticator.SingleSignOn" /> --> <!-- Access log processes all example. Documentation at: /docs/config/valve.html Note: The pattern used is equivalent to using pattern="common" --> <!-- <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>
--------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org