一次tomcat配置参数调优Jmeter压力测试记录前后对比

时间:2022-09-07 08:09:08

使用的tomcat版本为:apache-tomcat-7.0.53

使用测试工具Jmeter版本为:apache-jmeter-2.12

1、测试前tomat的"server.xml"配置文件(使用tomcat的默认配置,未做任何修改)

<?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">
<!-- 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" />
<!--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" />
<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 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 BIO 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.Http11Protocol"
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 &quot;%r&quot; %s %b" /> </Host>
</Engine>
</Service>
</Server>

2、使用Jmeter测试工具对tomcat进行压力测试,压力参数如下:

一次tomcat配置参数调优Jmeter压力测试记录前后对比

上面我使用Jmeter工具模拟800个用户同时访问tomcat服务器,每个用户循环访问10次,共8000次请求。

3、使用Jmeter发送的数据为json字符串,POST请求写数据:

一次tomcat配置参数调优Jmeter压力测试记录前后对比

4、测试结果(聚合报告):

一次tomcat配置参数调优Jmeter压力测试记录前后对比

我们总共发送了8000次请求,而出错率高达23.39%!就是说在8000次请求当中,有1871个请求是失败的(请求被拒绝)。因为tomcat的默认配置扛不住这么高的并发,导致tomcat的连接池处理不过来,请求直接被拒绝。

一次tomcat配置参数调优Jmeter压力测试记录前后对比

5、开始调整tomcat的配置参数,下面是调整后的server.xml配置(注意高亮部分):

<?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">
<!-- 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" />
<!--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" />
<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="600" 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="org.apache.coyote.http11.Http11NioProtocol"
connectionTimeout="20000"
redirectPort="8443"
enableLookups="false"
maxPostSize="10485760"
acceptCount="100"
acceptorThreadCount="2"
disableUploadTimeout="true"
maxConnections="10000"
SSLEnabled="false"/> <!-- Define a SSL HTTP/1.1 Connector on port 8443
This connector uses the BIO 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.Http11Protocol"
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 &quot;%r&quot; %s %b" /> </Host>
</Engine>
</Service>
</Server>

在上面的配置中,我开启了连接池 tomcatThreadPool,最大线程数 maxThreads 设置为 600,并使用 Http11NioProtocol等等。

6、使用的上面的配置,重启tomcat,使用同样的Jmeter压力参数再次进行测试,测试结果(聚合报告)如下:

一次tomcat配置参数调优Jmeter压力测试记录前后对比

把并发数从800提升到1000,再次测试:

一次tomcat配置参数调优Jmeter压力测试记录前后对比

测试结果,出错率依然为0:

一次tomcat配置参数调优Jmeter压力测试记录前后对比

7、扩展:在使用测试工具Jmeter的时候存在一个问题,就是如果使用它的GUI界面模式来测试,短时间内还凑合,时间稍微长一点,就会卡死(内存溢出)。

官方说,在实际测试的时候,千万不要使用Jmeter的GUI模式,而要使用非GUI模式,即使用命令行模式。

上面的例子都是使用的Jmeter的GUI模式进行测试的。下面是使用命令行模式来测试。下面是我们模拟的百万请求(1000个并发)测试,并发配置参数如下:

一次tomcat配置参数调优Jmeter压力测试记录前后对比

在上图中,我们模拟1000个用户并发访问,每个用户访问1000次,总共一百万次请求。

将上面的配置保存到一个命令为"friends.jmx"的文件中,然后在使用命令行模式启动它。

由于测试结果较多,不方便截图,就将命令行模式下测试过程中的输出内容复制如下:

D:\java\apache-jmeter-2.12\bin>jmeter -t friends.jmx  -n -l 234.jtl
Creating summariser <summary>
Created the tree successfully using friends.jmx
Starting the test @ Fri Apr 07 16:42:04 CST 2017 (1491554524679)
Waiting for possible shutdown message on port 4445
summary + 17147 in 24.2s = 708.3/s Avg: 1254 Min: 39 Max: 4401 Err: 0 (0.00%) Active: 1000 Started: 1000 Finished: 0
summary + 19138 in 32s = 606.1/s Avg: 1567 Min: 323 Max: 11062 Err: 0 (0.00%) Active: 1000 Started: 1000 Finished: 0
summary = 36285 in 54.2s = 669.4/s Avg: 1419 Min: 39 Max: 11062 Err: 0 (0.00%)
summary + 22634 in 31.5s = 719.6/s Avg: 1327 Min: 352 Max: 8062 Err: 0 (0.00%) Active: 1000 Started: 1000 Finished: 0
summary = 58919 in 84.2s = 699.7/s Avg: 1384 Min: 39 Max: 11062 Err: 0 (0.00%)
summary + 25432 in 31.2s = 814.5/s Avg: 1175 Min: 356 Max: 2475 Err: 0 (0.00%) Active: 1000 Started: 1000 Finished: 0
summary = 84351 in 114s = 738.6/s Avg: 1321 Min: 39 Max: 11062 Err: 0 (0.00%)
summary + 24041 in 31.5s = 763.9/s Avg: 1241 Min: 348 Max: 2499 Err: 0 (0.00%) Active: 1000 Started: 1000 Finished: 0
summary = 108392 in 144s = 751.7/s Avg: 1303 Min: 39 Max: 11062 Err: 0 (0.00%)
summary + 22884 in 32s = 719.1/s Avg: 1321 Min: 353 Max: 4079 Err: 0 (0.00%) Active: 1000 Started: 1000 Finished: 0
summary = 131276 in 174s = 753.5/s Avg: 1306 Min: 39 Max: 11062 Err: 0 (0.00%)
summary + 28141 in 31.3s = 898.9/s Avg: 1065 Min: 339 Max: 2258 Err: 0 (0.00%) Active: 1000 Started: 1000 Finished: 0
summary = 159417 in 204s = 780.7/s Avg: 1264 Min: 39 Max: 11062 Err: 0 (0.00%)
summary + 25973 in 32s = 818.6/s Avg: 1141 Min: 349 Max: 3318 Err: 0 (0.00%) Active: 1000 Started: 1000 Finished: 0
summary = 185390 in 234s = 791.6/s Avg: 1246 Min: 39 Max: 11062 Err: 0 (0.00%)
summary + 25169 in 33.1s = 761.4/s Avg: 1171 Min: 343 Max: 3232 Err: 0 (0.00%) Active: 1000 Started: 1000 Finished: 0
summary = 210559 in 264s = 796.4/s Avg: 1237 Min: 39 Max: 11062 Err: 0 (0.00%)
summary + 26825 in 32.5s = 826.4/s Avg: 1153 Min: 309 Max: 3541 Err: 0 (0.00%) Active: 1000 Started: 1000 Finished: 0
summary = 237384 in 294s = 806.9/s Avg: 1228 Min: 39 Max: 11062 Err: 0 (0.00%)
summary + 26856 in 31.1s = 863.8/s Avg: 1115 Min: 321 Max: 2811 Err: 0 (0.00%) Active: 1000 Started: 1000 Finished: 0
summary = 264240 in 324s = 815.1/s Avg: 1216 Min: 39 Max: 11062 Err: 0 (0.00%)
summary + 26724 in 32s = 846.7/s Avg: 1117 Min: 333 Max: 3430 Err: 0 (0.00%) Active: 1000 Started: 1000 Finished: 0
summary = 290964 in 354s = 821.5/s Avg: 1207 Min: 39 Max: 11062 Err: 0 (0.00%)
summary + 30515 in 31.4s = 973.3/s Avg: 988 Min: 310 Max: 2843 Err: 0 (0.00%) Active: 1000 Started: 1000 Finished: 0
summary = 321479 in 384s = 836.7/s Avg: 1186 Min: 39 Max: 11062 Err: 0 (0.00%)
summary + 30071 in 31s = 969.0/s Avg: 994 Min: 312 Max: 2164 Err: 0 (0.00%) Active: 1000 Started: 1000 Finished: 0
summary = 351550 in 414s = 848.7/s Avg: 1170 Min: 39 Max: 11062 Err: 0 (0.00%)
summary + 25980 in 32s = 815.7/s Avg: 1155 Min: 311 Max: 2855 Err: 0 (0.00%) Active: 1000 Started: 1000 Finished: 0
summary = 377530 in 444s = 849.9/s Avg: 1169 Min: 39 Max: 11062 Err: 0 (0.00%)
summary + 30509 in 31s = 982.8/s Avg: 985 Min: 308 Max: 2401 Err: 0 (0.00%) Active: 1000 Started: 1000 Finished: 0
summary = 408039 in 474s = 860.5/s Avg: 1155 Min: 39 Max: 11062 Err: 0 (0.00%)
summary + 28383 in 32s = 900.1/s Avg: 1057 Min: 317 Max: 2541 Err: 0 (0.00%) Active: 1000 Started: 1000 Finished: 0
summary = 436422 in 504s = 865.6/s Avg: 1149 Min: 39 Max: 11062 Err: 0 (0.00%)
summary + 29433 in 31.4s = 935.9/s Avg: 1018 Min: 321 Max: 2596 Err: 0 (0.00%) Active: 1000 Started: 1000 Finished: 0
summary = 465855 in 534s = 872.1/s Avg: 1140 Min: 39 Max: 11062 Err: 0 (0.00%)
summary + 27814 in 31.2s = 890.4/s Avg: 1079 Min: 332 Max: 2321 Err: 0 (0.00%) Active: 1000 Started: 1000 Finished: 0
summary = 493669 in 564s = 875.0/s Avg: 1137 Min: 39 Max: 11062 Err: 0 (0.00%)
summary + 26025 in 32s = 822.2/s Avg: 1147 Min: 323 Max: 3305 Err: 0 (0.00%) Active: 1000 Started: 1000 Finished: 0
summary = 519694 in 594s = 874.6/s Avg: 1138 Min: 39 Max: 11062 Err: 0 (0.00%)
summary + 28340 in 32s = 891.1/s Avg: 1062 Min: 321 Max: 2715 Err: 0 (0.00%) Active: 1000 Started: 1000 Finished: 0
summary = 548034 in 624s = 878.0/s Avg: 1134 Min: 39 Max: 11062 Err: 0 (0.00%)
summary + 19358 in 31.2s = 620.2/s Avg: 1546 Min: 315 Max: 4262 Err: 0 (0.00%) Active: 1000 Started: 1000 Finished: 0
summary = 567392 in 654s = 867.3/s Avg: 1148 Min: 39 Max: 11062 Err: 0 (0.00%)
summary + 25333 in 32s = 797.2/s Avg: 1186 Min: 309 Max: 3143 Err: 0 (0.00%) Active: 1000 Started: 1000 Finished: 0
summary = 592725 in 684s = 866.3/s Avg: 1149 Min: 39 Max: 11062 Err: 0 (0.00%)
summary + 22455 in 31.1s = 721.9/s Avg: 1310 Min: 352 Max: 2944 Err: 0 (0.00%) Active: 1000 Started: 1000 Finished: 0
summary = 615180 in 714s = 861.2/s Avg: 1155 Min: 39 Max: 11062 Err: 0 (0.00%)
summary + 24950 in 33s = 766.7/s Avg: 1215 Min: 324 Max: 3498 Err: 0 (0.00%) Active: 1000 Started: 1000 Finished: 0
summary = 640130 in 744s = 860.2/s Avg: 1158 Min: 39 Max: 11062 Err: 0 (0.00%)
summary + 26601 in 32s = 834.5/s Avg: 1133 Min: 319 Max: 2577 Err: 0 (0.00%) Active: 1000 Started: 1000 Finished: 0
summary = 666731 in 774s = 861.2/s Avg: 1157 Min: 39 Max: 11062 Err: 0 (0.00%)
summary + 24229 in 32.1s = 755.2/s Avg: 1242 Min: 314 Max: 4149 Err: 0 (0.00%) Active: 1000 Started: 1000 Finished: 0
summary = 690960 in 804s = 859.2/s Avg: 1160 Min: 39 Max: 11062 Err: 0 (0.00%)
summary + 27373 in 31.3s = 874.1/s Avg: 1069 Min: 327 Max: 2817 Err: 0 (0.00%) Active: 1000 Started: 1000 Finished: 0
summary = 718333 in 835s = 860.8/s Avg: 1156 Min: 39 Max: 11062 Err: 0 (0.00%)
summary + 15146 in 32s = 477.5/s Avg: 2004 Min: 318 Max: 5495 Err: 0 (0.00%) Active: 1000 Started: 1000 Finished: 0
summary = 733479 in 864s = 848.7/s Avg: 1174 Min: 39 Max: 11062 Err: 0 (0.00%)
summary + 23767 in 32s = 746.7/s Avg: 1273 Min: 320 Max: 3289 Err: 0 (0.00%) Active: 1000 Started: 1000 Finished: 0
summary = 757246 in 894s = 846.8/s Avg: 1177 Min: 39 Max: 11062 Err: 0 (0.00%)
summary + 20449 in 32s = 647.4/s Avg: 1467 Min: 335 Max: 4910 Err: 0 (0.00%) Active: 1000 Started: 1000 Finished: 0
summary = 777695 in 925s = 841.2/s Avg: 1184 Min: 39 Max: 11062 Err: 0 (0.00%)
summary + 24642 in 31.1s = 791.7/s Avg: 1218 Min: 334 Max: 2979 Err: 0 (0.00%) Active: 1000 Started: 1000 Finished: 0
summary = 802337 in 954s = 840.8/s Avg: 1185 Min: 39 Max: 11062 Err: 0 (0.00%)
summary + 18182 in 31.5s = 577.6/s Avg: 1642 Min: 333 Max: 8761 Err: 0 (0.00%) Active: 1000 Started: 1000 Finished: 0
summary = 820519 in 984s = 833.7/s Avg: 1196 Min: 39 Max: 11062 Err: 0 (0.00%)
summary + 17905 in 32.4s = 552.1/s Avg: 1446 Min: 318 Max: 9666 Err: 0 (0.00%) Active: 1000 Started: 1000 Finished: 0
summary = 838424 in 1015s = 825.8/s Avg: 1201 Min: 39 Max: 11062 Err: 0 (0.00%)
summary + 21452 in 39s = 556.4/s Avg: 1592 Min: 311 Max: 10062 Err: 0 (0.00%) Active: 1000 Started: 1000 Finished: 0
summary = 859876 in 1044s = 823.5/s Avg: 1211 Min: 39 Max: 11062 Err: 0 (0.00%)
summary + 27024 in 32s = 854.6/s Avg: 1102 Min: 322 Max: 3369 Err: 0 (0.00%) Active: 1000 Started: 1000 Finished: 0
summary = 886900 in 1074s = 825.6/s Avg: 1207 Min: 39 Max: 11062 Err: 0 (0.00%)
summary + 27843 in 32s = 881.1/s Avg: 1086 Min: 354 Max: 2481 Err: 0 (0.00%) Active: 1000 Started: 1000 Finished: 0
summary = 914743 in 1104s = 828.4/s Avg: 1204 Min: 39 Max: 11062 Err: 0 (0.00%)
summary + 27054 in 31.4s = 862.5/s Avg: 1107 Min: 330 Max: 3081 Err: 0 (0.00%) Active: 1000 Started: 1000 Finished: 0
summary = 941797 in 1134s = 830.4/s Avg: 1201 Min: 39 Max: 11062 Err: 0 (0.00%)
summary + 28293 in 31.4s = 900.5/s Avg: 1033 Min: 324 Max: 2393 Err: 0 (0.00%) Active: 997 Started: 1000 Finished: 3
summary = 970090 in 1164s = 833.2/s Avg: 1196 Min: 39 Max: 11062 Err: 0 (0.00%)
summary + 27095 in 32.4s = 835.4/s Avg: 1031 Min: 26 Max: 2854 Err: 0 (0.00%) Active: 405 Started: 1000 Finished: 595
summary = 997185 in 1194s = 835.0/s Avg: 1191 Min: 26 Max: 11062 Err: 0 (0.00%)
summary + 2815 in 7s = 426.3/s Avg: 520 Min: 14 Max: 1910 Err: 0 (0.00%) Active: 0 Started: 1000 Finished: 1000
summary = 1000000 in 1200s = 833.1/s Avg: 1190 Min: 14 Max: 11062 Err: 0 (0.00%)
Tidying up ... @ Fri Apr 07 17:02:06 CST 2017 (1491555726182)
... end of run
D:\java\apache-jmeter-2.12\bin>

在这次测试中,我模拟了1000个用户并发访问一台tomcat,每个用户访问1000次,共一百万次请求。出错率为0(0.00%),吞吐量最高到达982.8/s。

将并发数提高到2000,共20万次请求:

一次tomcat配置参数调优Jmeter压力测试记录前后对比

出错率依然为0(0.00%):

D:\java\apache-jmeter-2.12\bin>jmeter -t friends.jmx  -n -l 456.jtl
Creating summariser <summary>
Created the tree successfully using friends.jmx
Starting the test @ Fri Apr 07 17:13:39 CST 2017 (1491556419293)
Waiting for possible shutdown message on port 4445
summary + 4181 in 19.1s = 218.7/s Avg: 5393 Min: 19 Max: 9709 Err: 0 (0.00%) Active: 2000 Started: 2000 Finished: 0
summary + 9699 in 38s = 258.0/s Avg: 6334 Min: 4014 Max: 10011 Err: 0 (0.00%) Active: 2000 Started: 2000 Finished: 0
summary = 13880 in 49.1s = 282.6/s Avg: 6051 Min: 19 Max: 10011 Err: 0 (0.00%)
summary + 10490 in 37.3s = 281.0/s Avg: 5731 Min: 3935 Max: 7896 Err: 0 (0.00%) Active: 2000 Started: 2000 Finished: 0
summary = 24370 in 79.1s = 308.0/s Avg: 5913 Min: 19 Max: 10011 Err: 0 (0.00%)
summary + 15301 in 37.1s = 412.3/s Avg: 4112 Min: 1845 Max: 7993 Err: 0 (0.00%) Active: 2000 Started: 2000 Finished: 0
summary = 39671 in 109s = 363.5/s Avg: 5218 Min: 19 Max: 10011 Err: 0 (0.00%)
summary + 22462 in 33.2s = 676.8/s Avg: 2661 Min: 1702 Max: 3944 Err: 0 (0.00%) Active: 2000 Started: 2000 Finished: 0
summary = 62133 in 139s = 446.6/s Avg: 4294 Min: 19 Max: 10011 Err: 0 (0.00%)
summary + 22527 in 33.4s = 675.3/s Avg: 2670 Min: 1719 Max: 3937 Err: 0 (0.00%) Active: 2000 Started: 2000 Finished: 0
summary = 84660 in 169s = 500.6/s Avg: 3862 Min: 19 Max: 10011 Err: 0 (0.00%)
summary + 23234 in 34s = 692.5/s Avg: 2596 Min: 1668 Max: 4160 Err: 0 (0.00%) Active: 2000 Started: 2000 Finished: 0
summary = 107894 in 199s = 541.9/s Avg: 3589 Min: 19 Max: 10011 Err: 0 (0.00%)
summary + 23916 in 33.2s = 721.1/s Avg: 2505 Min: 1663 Max: 3630 Err: 0 (0.00%) Active: 2000 Started: 2000 Finished: 0
summary = 131810 in 229s = 575.3/s Avg: 3392 Min: 19 Max: 10011 Err: 0 (0.00%)
summary + 22205 in 33.2s = 669.1/s Avg: 2702 Min: 1696 Max: 5042 Err: 0 (0.00%) Active: 2000 Started: 2000 Finished: 0
summary = 154015 in 259s = 594.4/s Avg: 3293 Min: 19 Max: 10011 Err: 0 (0.00%)
summary + 23864 in 33s = 725.7/s Avg: 2510 Min: 1703 Max: 3599 Err: 0 (0.00%) Active: 2000 Started: 2000 Finished: 0
summary = 177879 in 289s = 615.2/s Avg: 3188 Min: 19 Max: 10011 Err: 0 (0.00%)
summary + 22121 in 31.4s = 704.1/s Avg: 2465 Min: 16 Max: 4251 Err: 0 (0.00%) Active: 0 Started: 2000 Finished: 2000
summary = 200000 in 317s = 629.9/s Avg: 3108 Min: 16 Max: 10011 Err: 0 (0.00%)
Tidying up ... @ Fri Apr 07 17:18:58 CST 2017 (1491556738363)
... end of run
D:\java\apache-jmeter-2.12\bin>

继续,将并发数提高到3000,总共生产30万条消息(由于我的消息是通过tomcat写入到kafka的,所以使用监控工具观察到所有消息都成功被写入到kafka集群),消息全部发送成功,由于我开启了消费者,所以,所有的消息也都被成功消费:

一次tomcat配置参数调优Jmeter压力测试记录前后对比

由于我们的消息消费者是要写库的,所以,查看数据库,所有的消息都成功入库(1条消息对应数据库中的2条记录,所以30万条消息在数据库中产生60万条记录):

一次tomcat配置参数调优Jmeter压力测试记录前后对比

观察Jmeter命令行输出:

D:\java\apache-jmeter-2.12\bin>jmeter -t friends.jmx -n -l 111.jtl
Creating summariser <summary>
Created the tree successfully using friends.jmx
Starting the test @ Fri Apr 07 17:45:45 CST 2017 (1491558345806)
Waiting for possible shutdown message on port 4445
summary + 648 in 13s = 50.6/s Avg: 4819 Min: 39 Max: 10134 Err: 0 (0.00%) Active: 3000 Started: 3000 Finished: 0
summary + 4834 in 40s = 121.9/s Avg: 12919 Min: 3546 Max: 21456 Err: 0 (0.00%) Active: 3000 Started: 3000 Finished: 0
summary = 5482 in 43s = 128.2/s Avg: 11962 Min: 39 Max: 21456 Err: 0 (0.00%)
summary + 10587 in 51s = 209.2/s Avg: 10089 Min: 6026 Max: 21373 Err: 0 (0.00%) Active: 3000 Started: 3000 Finished: 0
summary = 16069 in 73s = 220.9/s Avg: 10728 Min: 39 Max: 21456 Err: 0 (0.00%)
summary + 12415 in 40s = 312.9/s Avg: 7343 Min: 5107 Max: 10677 Err: 0 (0.00%) Active: 3000 Started: 3000 Finished: 0
summary = 28484 in 103s = 277.2/s Avg: 9253 Min: 39 Max: 21456 Err: 0 (0.00%)
summary + 12369 in 38.3s = 322.6/s Avg: 7336 Min: 5090 Max: 10130 Err: 0 (0.00%) Active: 3000 Started: 3000 Finished: 0
summary = 40853 in 133s = 307.7/s Avg: 8672 Min: 39 Max: 21456 Err: 0 (0.00%)
summary + 12525 in 38.1s = 329.0/s Avg: 7201 Min: 5334 Max: 10620 Err: 0 (0.00%) Active: 3000 Started: 3000 Finished: 0
summary = 53378 in 163s = 328.0/s Avg: 8327 Min: 39 Max: 21456 Err: 0 (0.00%)
summary + 12661 in 38s = 333.9/s Avg: 6756 Min: 5032 Max: 10080 Err: 0 (0.00%) Active: 3000 Started: 3000 Finished: 0
summary = 66039 in 193s = 342.6/s Avg: 8026 Min: 39 Max: 21456 Err: 0 (0.00%)
summary + 11966 in 40s = 301.7/s Avg: 7968 Min: 4862 Max: 12396 Err: 0 (0.00%) Active: 3000 Started: 3000 Finished: 0
summary = 78005 in 223s = 350.2/s Avg: 8017 Min: 39 Max: 21456 Err: 0 (0.00%)
summary + 11378 in 37.2s = 306.1/s Avg: 7517 Min: 4792 Max: 13336 Err: 0 (0.00%) Active: 3000 Started: 3000 Finished: 0
summary = 89383 in 253s = 353.6/s Avg: 7953 Min: 39 Max: 21456 Err: 0 (0.00%)
summary + 13119 in 43.3s = 302.9/s Avg: 7122 Min: 5280 Max: 13472 Err: 0 (0.00%) Active: 3000 Started: 3000 Finished: 0
summary = 102502 in 283s = 362.5/s Avg: 7847 Min: 39 Max: 21456 Err: 0 (0.00%)
summary + 12872 in 38.3s = 336.0/s Avg: 6896 Min: 4840 Max: 9639 Err: 0 (0.00%) Active: 3000 Started: 3000 Finished: 0
summary = 115374 in 313s = 368.9/s Avg: 7741 Min: 39 Max: 21456 Err: 0 (0.00%)
summary + 11828 in 39s = 303.5/s Avg: 7440 Min: 5417 Max: 10629 Err: 0 (0.00%) Active: 3000 Started: 3000 Finished: 0
summary = 127202 in 343s = 371.1/s Avg: 7713 Min: 39 Max: 21456 Err: 0 (0.00%)
summary + 12362 in 40.3s = 306.9/s Avg: 7494 Min: 5546 Max: 10556 Err: 0 (0.00%) Active: 3000 Started: 3000 Finished: 0
summary = 139564 in 373s = 374.4/s Avg: 7693 Min: 39 Max: 21456 Err: 0 (0.00%)
summary + 12708 in 39s = 326.0/s Avg: 7106 Min: 5465 Max: 9505 Err: 0 (0.00%) Active: 3000 Started: 3000 Finished: 0
summary = 152272 in 403s = 378.1/s Avg: 7644 Min: 39 Max: 21456 Err: 0 (0.00%)
summary + 11576 in 39s = 298.5/s Avg: 7732 Min: 5463 Max: 10985 Err: 0 (0.00%) Active: 3000 Started: 3000 Finished: 0
summary = 163848 in 433s = 378.6/s Avg: 7651 Min: 39 Max: 21456 Err: 0 (0.00%)
summary + 12228 in 39s = 313.2/s Avg: 7451 Min: 5210 Max: 10799 Err: 0 (0.00%) Active: 3000 Started: 3000 Finished: 0
summary = 176076 in 463s = 380.5/s Avg: 7637 Min: 39 Max: 21456 Err: 0 (0.00%)
summary + 12511 in 38s = 332.3/s Avg: 7110 Min: 5069 Max: 9998 Err: 0 (0.00%) Active: 3000 Started: 3000 Finished: 0
summary = 188587 in 493s = 382.7/s Avg: 7602 Min: 39 Max: 21456 Err: 0 (0.00%)
summary + 12147 in 39s = 314.1/s Avg: 7554 Min: 4700 Max: 12926 Err: 0 (0.00%) Active: 3000 Started: 3000 Finished: 0
summary = 200734 in 523s = 384.0/s Avg: 7599 Min: 39 Max: 21456 Err: 0 (0.00%)
summary + 13479 in 37.4s = 360.0/s Avg: 6601 Min: 4692 Max: 9343 Err: 0 (0.00%) Active: 3000 Started: 3000 Finished: 0
summary = 214213 in 553s = 387.5/s Avg: 7536 Min: 39 Max: 21456 Err: 0 (0.00%)
summary + 12934 in 38s = 341.2/s Avg: 6994 Min: 5108 Max: 10163 Err: 0 (0.00%) Active: 3000 Started: 3000 Finished: 0
summary = 227147 in 583s = 389.7/s Avg: 7505 Min: 39 Max: 21456 Err: 0 (0.00%)
summary + 13186 in 37.1s = 355.1/s Avg: 6777 Min: 5141 Max: 9263 Err: 0 (0.00%) Active: 3000 Started: 3000 Finished: 0
summary = 240333 in 613s = 392.2/s Avg: 7465 Min: 39 Max: 21456 Err: 0 (0.00%)
summary + 13866 in 39s = 359.3/s Avg: 6445 Min: 4513 Max: 8881 Err: 0 (0.00%) Active: 3000 Started: 3000 Finished: 0
summary = 254199 in 643s = 395.5/s Avg: 7410 Min: 39 Max: 21456 Err: 0 (0.00%)
summary + 13119 in 38.3s = 342.6/s Avg: 6958 Min: 4981 Max: 10002 Err: 0 (0.00%) Active: 3000 Started: 3000 Finished: 0
summary = 267318 in 673s = 397.4/s Avg: 7387 Min: 39 Max: 21456 Err: 0 (0.00%)
summary + 13629 in 37.1s = 367.4/s Avg: 6544 Min: 4769 Max: 8823 Err: 0 (0.00%) Active: 3000 Started: 3000 Finished: 0
summary = 280947 in 703s = 399.8/s Avg: 7346 Min: 39 Max: 21456 Err: 0 (0.00%)
summary + 12546 in 38s = 330.6/s Avg: 7252 Min: 4751 Max: 9940 Err: 0 (0.00%) Active: 2735 Started: 3000 Finished: 265
summary = 293493 in 733s = 400.5/s Avg: 7342 Min: 39 Max: 21456 Err: 0 (0.00%)
summary + 6507 in 22.2s = 293.4/s Avg: 5450 Min: 146 Max: 9107 Err: 0 (0.00%) Active: 0 Started: 3000 Finished: 3000
summary = 300000 in 748s = 401.1/s Avg: 7301 Min: 39 Max: 21456 Err: 0 (0.00%)
Tidying up ... @ Fri Apr 07 17:58:15 CST 2017 (1491559095281)
... end of run
D:\java\apache-jmeter-2.12\bin>

出错率依然为0,所有请求全部成功。

将并发数提高到4000,生产消费情况很好:

一次tomcat配置参数调优Jmeter压力测试记录前后对比

消费入库也没有问题:

一次tomcat配置参数调优Jmeter压力测试记录前后对比

Jmeter测试结果:

Starting the test @ Fri Apr 07 18:22:37 CST 2017 (1491560557507)
Waiting for possible shutdown message on port 4445
summary + 3775 in 21s = 181.0/s Avg: 4033 Min: 31 Max: 8840 Err: 0 (0.00%) Active: 4000 Started: 4000 Finished: 0
summary + 7477 in 40.4s = 185.1/s Avg: 13595 Min: 5657 Max: 20767 Err: 0 (0.00%) Active: 4000 Started: 4000 Finished: 0
summary = 11252 in 51s = 221.2/s Avg: 10387 Min: 31 Max: 20767 Err: 0 (0.00%)
summary + 10320 in 43s = 241.5/s Avg: 11598 Min: 8916 Max: 14707 Err: 0 (0.00%) Active: 4000 Started: 4000 Finished: 0
summary = 21572 in 81s = 266.8/s Avg: 10966 Min: 31 Max: 20767 Err: 0 (0.00%)
summary + 10138 in 43.4s = 233.4/s Avg: 11722 Min: 9626 Max: 14636 Err: 0 (0.00%) Active: 4000 Started: 4000 Finished: 0
summary = 31710 in 111s = 286.0/s Avg: 11208 Min: 31 Max: 20767 Err: 0 (0.00%)
summary + 10008 in 43s = 233.0/s Avg: 11985 Min: 9790 Max: 15285 Err: 0 (0.00%) Active: 4000 Started: 4000 Finished: 0
summary = 41718 in 141s = 296.2/s Avg: 11395 Min: 31 Max: 20767 Err: 0 (0.00%)
summary + 10050 in 45s = 225.8/s Avg: 12009 Min: 9999 Max: 14859 Err: 0 (0.00%) Active: 4000 Started: 4000 Finished: 0
summary = 51768 in 171s = 303.0/s Avg: 11514 Min: 31 Max: 20767 Err: 0 (0.00%)
summary + 10202 in 44.2s = 230.8/s Avg: 11879 Min: 9765 Max: 14854 Err: 0 (0.00%) Active: 4000 Started: 4000 Finished: 0
summary = 61970 in 201s = 308.5/s Avg: 11574 Min: 31 Max: 20767 Err: 0 (0.00%)
summary + 10566 in 44s = 242.0/s Avg: 11527 Min: 9058 Max: 14406 Err: 0 (0.00%) Active: 4000 Started: 4000 Finished: 0
summary = 72536 in 231s = 314.2/s Avg: 11567 Min: 31 Max: 20767 Err: 0 (0.00%)
summary + 10372 in 43s = 241.7/s Avg: 11385 Min: 8889 Max: 14825 Err: 0 (0.00%) Active: 4000 Started: 4000 Finished: 0
summary = 82908 in 261s = 317.8/s Avg: 11544 Min: 31 Max: 20767 Err: 0 (0.00%)
summary + 10358 in 44s = 237.7/s Avg: 11415 Min: 8957 Max: 14799 Err: 0 (0.00%) Active: 4000 Started: 4000 Finished: 0
summary = 93266 in 291s = 320.7/s Avg: 11530 Min: 31 Max: 20767 Err: 0 (0.00%)
summary + 10422 in 44.3s = 235.5/s Avg: 11467 Min: 8756 Max: 14886 Err: 0 (0.00%) Active: 4000 Started: 4000 Finished: 0
summary = 103688 in 321s = 323.2/s Avg: 11524 Min: 31 Max: 20767 Err: 0 (0.00%)
summary + 8421 in 44s = 192.9/s Avg: 13620 Min: 10138 Max: 19553 Err: 0 (0.00%) Active: 4000 Started: 4000 Finished: 0
summary = 112109 in 351s = 319.5/s Avg: 11681 Min: 31 Max: 20767 Err: 0 (0.00%)
summary + 9998 in 48s = 208.6/s Avg: 12642 Min: 9717 Max: 18517 Err: 0 (0.00%) Active: 4000 Started: 4000 Finished: 0
summary = 122107 in 381s = 320.6/s Avg: 11760 Min: 31 Max: 20767 Err: 0 (0.00%)
summary + 10593 in 42.5s = 249.5/s Avg: 11119 Min: 8767 Max: 14794 Err: 0 (0.00%) Active: 4000 Started: 4000 Finished: 0
summary = 132700 in 411s = 323.0/s Avg: 11709 Min: 31 Max: 20767 Err: 0 (0.00%)
summary + 10306 in 44.3s = 232.7/s Avg: 11958 Min: 9246 Max: 15741 Err: 0 (0.00%) Active: 4000 Started: 4000 Finished: 0
summary = 143006 in 441s = 324.4/s Avg: 11727 Min: 31 Max: 20767 Err: 0 (0.00%)
summary + 9773 in 44s = 222.6/s Avg: 11779 Min: 9441 Max: 16077 Err: 0 (0.00%) Active: 4000 Started: 4000 Finished: 0
summary = 152779 in 471s = 324.5/s Avg: 11730 Min: 31 Max: 20767 Err: 0 (0.00%)
summary + 9884 in 45.2s = 218.9/s Avg: 12577 Min: 9397 Max: 16392 Err: 0 (0.00%) Active: 4000 Started: 4000 Finished: 0
summary = 162663 in 501s = 324.8/s Avg: 11781 Min: 31 Max: 20767 Err: 0 (0.00%)
summary + 10397 in 44.1s = 235.9/s Avg: 11480 Min: 9245 Max: 14618 Err: 0 (0.00%) Active: 4000 Started: 4000 Finished: 0
summary = 173060 in 531s = 326.0/s Avg: 11763 Min: 31 Max: 20767 Err: 0 (0.00%)
summary + 10198 in 44s = 232.1/s Avg: 11824 Min: 9621 Max: 15128 Err: 0 (0.00%) Active: 4000 Started: 4000 Finished: 0
summary = 183258 in 561s = 326.7/s Avg: 11767 Min: 31 Max: 20767 Err: 0 (0.00%)
summary + 10274 in 45s = 230.5/s Avg: 11789 Min: 9241 Max: 15208 Err: 0 (0.00%) Active: 4000 Started: 4000 Finished: 0
summary = 193532 in 591s = 327.5/s Avg: 11768 Min: 31 Max: 20767 Err: 0 (0.00%)
summary + 8742 in 43.1s = 202.9/s Avg: 11526 Min: 9322 Max: 18529 Err: 0 (0.00%) Active: 4000 Started: 4000 Finished: 0
summary = 202274 in 621s = 325.8/s Avg: 11757 Min: 31 Max: 20767 Err: 0 (0.00%)
summary + 6924 in 48.3s = 143.4/s Avg: 18617 Min: 12234 Max: 25378 Err: 0 (0.00%) Active: 4000 Started: 4000 Finished: 0
summary = 209198 in 651s = 321.4/s Avg: 11984 Min: 31 Max: 25378 Err: 0 (0.00%)
summary + 9617 in 48s = 201.1/s Avg: 13147 Min: 9157 Max: 19361 Err: 0 (0.00%) Active: 4000 Started: 4000 Finished: 0
summary = 218815 in 681s = 321.4/s Avg: 12036 Min: 31 Max: 25378 Err: 0 (0.00%)
summary + 6942 in 46s = 151.7/s Avg: 15959 Min: 10978 Max: 22863 Err: 0 (0.00%) Active: 4000 Started: 4000 Finished: 0
summary = 225757 in 711s = 317.6/s Avg: 12156 Min: 31 Max: 25378 Err: 0 (0.00%)
summary + 7144 in 50s = 143.5/s Avg: 17153 Min: 13563 Max: 22321 Err: 0 (0.00%) Active: 4000 Started: 4000 Finished: 0
summary = 232901 in 741s = 314.4/s Avg: 12309 Min: 31 Max: 25378 Err: 0 (0.00%)
summary + 7111 in 49s = 145.7/s Avg: 16632 Min: 13788 Max: 21481 Err: 0 (0.00%) Active: 4000 Started: 4000 Finished: 0
summary = 240012 in 771s = 311.4/s Avg: 12438 Min: 31 Max: 25378 Err: 0 (0.00%)
summary + 7329 in 51.3s = 142.9/s Avg: 16884 Min: 12875 Max: 22005 Err: 0 (0.00%) Active: 4000 Started: 4000 Finished: 0
summary = 247341 in 801s = 308.8/s Avg: 12569 Min: 31 Max: 25378 Err: 0 (0.00%)
summary + 7790 in 48.4s = 160.9/s Avg: 15362 Min: 12965 Max: 19288 Err: 0 (0.00%) Active: 4000 Started: 4000 Finished: 0
summary = 255131 in 831s = 307.1/s Avg: 12655 Min: 31 Max: 25378 Err: 0 (0.00%)
summary + 7025 in 49s = 144.2/s Avg: 16705 Min: 13182 Max: 22360 Err: 0 (0.00%) Active: 4000 Started: 4000 Finished: 0
summary = 262156 in 861s = 304.5/s Avg: 12763 Min: 31 Max: 25378 Err: 0 (0.00%)
summary + 7745 in 52s = 149.8/s Avg: 15742 Min: 12697 Max: 22083 Err: 0 (0.00%) Active: 4000 Started: 4000 Finished: 0
summary = 269901 in 891s = 303.0/s Avg: 12849 Min: 31 Max: 25378 Err: 0 (0.00%)
summary + 8206 in 48.2s = 170.3/s Avg: 15240 Min: 11474 Max: 19585 Err: 0 (0.00%) Active: 4000 Started: 4000 Finished: 0
summary = 278107 in 921s = 302.0/s Avg: 12919 Min: 31 Max: 25378 Err: 0 (0.00%)
summary + 8932 in 47s = 190.8/s Avg: 13550 Min: 9848 Max: 18164 Err: 0 (0.00%) Active: 4000 Started: 4000 Finished: 0
summary = 287039 in 951s = 301.9/s Avg: 12939 Min: 31 Max: 25378 Err: 0 (0.00%)
summary + 8380 in 44.4s = 188.6/s Avg: 14486 Min: 10374 Max: 20302 Err: 0 (0.00%) Active: 4000 Started: 4000 Finished: 0
summary = 295419 in 981s = 301.2/s Avg: 12983 Min: 31 Max: 25378 Err: 0 (0.00%)
summary + 6311 in 44.2s = 142.9/s Avg: 16150 Min: 10329 Max: 23918 Err: 0 (0.00%) Active: 4000 Started: 4000 Finished: 0
summary = 301730 in 1011s = 298.5/s Avg: 13049 Min: 31 Max: 25378 Err: 0 (0.00%)
summary + 6426 in 54s = 119.6/s Avg: 20032 Min: 11370 Max: 27921 Err: 0 (0.00%) Active: 4000 Started: 4000 Finished: 0
summary = 308156 in 1041s = 296.0/s Avg: 13195 Min: 31 Max: 27921 Err: 0 (0.00%)
summary + 6779 in 50.3s = 134.9/s Avg: 16057 Min: 11880 Max: 23077 Err: 0 (0.00%) Active: 4000 Started: 4000 Finished: 0
summary = 314935 in 1071s = 294.1/s Avg: 13256 Min: 31 Max: 27921 Err: 0 (0.00%)
summary + 3598 in 52.5s = 68.6/s Avg: 25638 Min: 17444 Max: 39481 Err: 0 (0.00%) Active: 4000 Started: 4000 Finished: 0
summary = 318533 in 1101s = 289.3/s Avg: 13396 Min: 31 Max: 39481 Err: 0 (0.00%)
summary + 7326 in 66s = 111.3/s Avg: 21817 Min: 12664 Max: 39509 Err: 0 (0.00%) Active: 4000 Started: 4000 Finished: 0
summary = 325859 in 1131s = 288.1/s Avg: 13585 Min: 31 Max: 39509 Err: 0 (0.00%)
summary + 9141 in 50s = 183.1/s Avg: 13977 Min: 10441 Max: 20329 Err: 0 (0.00%) Active: 4000 Started: 4000 Finished: 0
summary = 335000 in 1161s = 288.6/s Avg: 13596 Min: 31 Max: 39509 Err: 0 (0.00%)
summary + 8759 in 45.3s = 193.5/s Avg: 13192 Min: 10427 Max: 18457 Err: 0 (0.00%) Active: 4000 Started: 4000 Finished: 0
summary = 343759 in 1191s = 288.7/s Avg: 13586 Min: 31 Max: 39509 Err: 0 (0.00%)
summary + 6335 in 48s = 132.0/s Avg: 16089 Min: 10872 Max: 25864 Err: 0 (0.00%) Active: 4000 Started: 4000 Finished: 0
summary = 350094 in 1221s = 286.8/s Avg: 13631 Min: 31 Max: 39509 Err: 0 (0.00%)
summary + 4110 in 55s = 74.7/s Avg: 29966 Min: 19602 Max: 41019 Err: 0 (0.00%) Active: 4000 Started: 4000 Finished: 0
summary = 354204 in 1251s = 283.2/s Avg: 13821 Min: 31 Max: 41019 Err: 0 (0.00%)
summary + 9776 in 61s = 161.5/s Avg: 14348 Min: 9914 Max: 33466 Err: 0 (0.00%) Active: 4000 Started: 4000 Finished: 0
summary = 363980 in 1281s = 284.2/s Avg: 13835 Min: 31 Max: 41019 Err: 0 (0.00%)
summary + 9719 in 44s = 223.0/s Avg: 12375 Min: 9964 Max: 16078 Err: 0 (0.00%) Active: 3984 Started: 4000 Finished: 16
summary = 373699 in 1311s = 285.1/s Avg: 13797 Min: 31 Max: 41019 Err: 0 (0.00%)
summary + 10064 in 44.1s = 228.4/s Avg: 11693 Min: 9309 Max: 15164 Err: 0 (0.00%) Active: 3709 Started: 4000 Finished: 291
summary = 383763 in 1341s = 286.2/s Avg: 13742 Min: 31 Max: 41019 Err: 0 (0.00%)
summary + 8972 in 45s = 201.2/s Avg: 12063 Min: 9116 Max: 16202 Err: 0 (0.00%) Active: 3015 Started: 4000 Finished: 985
summary = 392735 in 1371s = 286.5/s Avg: 13703 Min: 31 Max: 41019 Err: 0 (0.00%)
summary + 7265 in 30s = 246.2/s Avg: 7274 Min: 15 Max: 13934 Err: 0 (0.00%) Active: 0 Started: 4000 Finished: 4000
summary = 400000 in 1387s = 288.3/s Avg: 13586 Min: 15 Max: 41019 Err: 0 (0.00%)
Tidying up ... @ Fri Apr 07 18:45:46 CST 2017 (1491561946415)
... end of run
D:\java\apache-jmeter-2.12\bin>

可见,依然没有问题。

一次tomcat配置参数调优Jmeter压力测试记录前后对比的更多相关文章

  1. Spark配置参数调优

    1.配置多个executor 在项目中,由于数据量为几百万甚至千万级别,如果一个executor装载的对象过多,会导致GC很慢.项目中,我们使一个worker节点执行app时启动多个executor, ...

  2. tomcat配置性能调优1----server&period;xml文件详解

    <?xml version='1.0' encoding='utf-8'?><!--  Licensed to the Apache Software Foundation (ASF ...

  3. JVM性能优化--JVM参数配置,使用JMeter简单测试配合说明参数调优

    一.JVM参数配置 1.常见参数配置 -XX:+PrintGC 每次触发GC的时候打印相关日志 -XX:+UseSerialGC 串行回收 -XX:+PrintGCDetails 更详细的GC日志 - ...

  4. 【学习】011 JVM参数调优配置

    自动内存管理机制 Java虚拟机原理 所谓虚拟机,就是一台虚拟的机器.他是一款软件,用来执行一系列虚拟计算指令,大体上虚拟机可以分为 系统虚拟机和程序虚拟机, 大名鼎鼎的Visual Box.Vmar ...

  5. 【nginx】nginx配置文件结构,内置变量及参数调优

    Nginx的配置文件是一个纯文本文件,它一般位于Nginx安装目录的conf目录下,整个配置文件是以block的形式组织的.每个block一般以一个大括号“{”来表示.block 可以分为几个层次,整 ...

  6. Tomcat参数调优包括日志、线程数、内存【转】

    [Tomcat中日志打印对性能测试的影响] 一般都提供了这样5个日志级别: ▪ Debug ▪ Info ▪ Warn ▪ Error ▪ Fatal 由于性能测试需要并发进行压力测试,如果日志级别是 ...

  7. JVM菜鸟进阶高手之路七(tomcat调优以及tomcat7、8性能对比)

    转载请注明原创出处,谢谢! 因为每个链路都会对其性能造成影响,应该是全链路的修改压测(ak大神经常说全链路!).本次基本就是局域网,所以并没有怎么优化,其实也应该考虑进去的. Linux系统参数层面的 ...

  8. JVM高手之路七(tomcat调优以及tomcat7、8性能对比)

         版权声明:本文为博主原创文章,未经博主允许不得转载. https://blog.csdn.net/lirenzuo/article/details/77164033 因为每个链路都会对其性能 ...

  9. 性能测试三十六:内存溢出和JVM常见参数及JVM参数调优

    堆内存溢出: 此种溢出,加内存只能缓解问题,不能根除问题,需优化代码堆内存中存在大量对象,这些对象都有被引用,当所有对象占用空间达到堆内存的最大值,就会出现内存溢出OutOfMemory:Java h ...

随机推荐

  1. 解读ASP&period;NET 5 &amp&semi; MVC6系列(13):TagHelper

    在新版的MVC6中,微软提供了强大的TagHelper功能,以便让我们摆脱如下的臃肿代码: @Html.LabelFor(model => model.FullName) @Html.EditF ...

  2. EasyUI相关

    失去焦点事件 validType:'length[4,15]',events:{blur: function(){}} 添加自定义属性 $.extend($.fn.validatebox.defaul ...

  3. 标题编辑 AndroidTagGroup

    地址: https://github.com/2dxgujun/AndroidTagGroup

  4. 20145129 《Java程序设计》第3周学习总结

    20145129 <Java程序设计>第3周学习总结 教材学习内容总结 类与对象 定义类 一个原始码中可以有多个类定义,但只有一个是公开类(public),并且文档中的主文档名必须和公开类 ...

  5. asp&period;net 用jquery判断fileupload上传文件的大小和类型和名字

    <script language="javascript" type="text/javascript"> //检查上传文件大小和获取文件名 fun ...

  6. python 多线程和多进程的区别 mutiprocessing theading

    多线程可以共享全局变量,多进程不能.多线程中,所有子线程的进程号相同:多进程中,不同的子进程进程号不同. #!/usr/bin/python # -*- coding:utf-8 -*- import ...

  7. MySQL 5&period;7忘记root密码如何修改&quest;

    一直以来,MySQL的应用和学习环境都是MySQL 5.6和之前的版本,也没有去关注新版本MySQL 5.7的变化和新特性.今天帮人处理忘记root密码的时时候,发现以前的方法不奏效了.具体情况如下所 ...

  8. UDP协议

    本文分析基于Linux Kernel 1.2.13 原创作品,转载请标明出处http://blog.csdn.net/yming0221/article/details/7532512 更多请看专栏, ...

  9. Linux下TFTP服务的安装、配置和操作

      TFTP是用来下载远程文件的最简单网络协议,它其于UDP协议而实现.嵌入式linux的tftp开发环境包括两个方面:一是linux服务器端的tftp-server支持,二是嵌入式目标系统的tftp ...

  10. react-native &OpenCurlyDoubleQuote;Unable to resolve module &&num;39&semi;AccessibilityInfo&&num;39&semi;” 的解决方案

    执行 react-native run-android 安装Android APP后却是一屏大红幕报 Unable to resolve module ‘AccessibilityInfo’ 的异常 ...