在Jmeter的log.jtl文件中,此消息java.net.ConnectException/Connection超时意味着什么? [英] What does this messge java.net.ConnectException/Connection timed out mean in log.jtl file of Jmeter?

查看:379
本文介绍了在Jmeter的log.jtl文件中,此消息java.net.ConnectException/Connection超时意味着什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用Jmeter进行负载测试. 在Google计算引擎上,我已经担心4台VM,一台正在运行的Tomcat服务器,一台正在运行的jmeter主服务器和两台正在运行的jmeter-server服务器. 我的测试计划只是对tomcat初始页面(即默认首页http://***.***.***.***/8080)的HTTP请求. 每个从站中有2000个用户,该计划将在5分钟内执行.

I'd like to do a loading test with Jmeter. On google compute engine, I've creared 4 VMs, one running tomcat server, one running jmeter master and two running jmeter-server. My test plan is just a HTTP Request to the splash page(i.e. default home page, http://***.***.***.***/8080) of tomcat. There are 2000 users in each slave, and the plan will be executed in 5 minutes.

jmeter主站终端上的消息如下:

Message on the terminal of the jmeter master are as following:

Waiting for possible Shutdown/StopTestNow/Heapdump message on port 4445
summary +      1 in 00:00:00 =    8.5/s Avg:     9 Min:     9 Max:     9 Err:     0 (0.00%) Active: 2 Started: 2 Finished: 0
summary + 300902 in 00:00:26 = 11425.9/s Avg:    75 Min:     0 Max:  1407 Err:     0 (0.00%) Active: 1745 Started: 1745 Finished: 0
summary = 300903 in 00:00:26 = 11375.0/s Avg:    75 Min:     0 Max:  1407 Err:     0 (0.00%)
summary + 321100 in 00:00:30 = 10703.3/s Avg:   243 Min:     0 Max:  7702 Err:     0 (0.00%) Active: 3727 Started: 3727 Finished: 0
summary = 622003 in 00:00:56 = 11018.1/s Avg:   162 Min:     0 Max:  7702 Err:     0 (0.00%)
summary + 314400 in 00:00:30 = 10478.6/s Avg:   372 Min:     0 Max: 31256 Err:     0 (0.00%) Active: 4000 Started: 4000 Finished: 0
summary = 936403 in 00:01:26 = 10830.9/s Avg:   232 Min:     0 Max: 31256 Err:     0 (0.00%)
summary + 313700 in 00:00:30 = 10458.1/s Avg:   366 Min:     0 Max: 31827 Err:     0 (0.00%) Active: 4000 Started: 4000 Finished: 0
summary = 1250103 in 00:01:56 = 10734.8/s Avg:   266 Min:     0 Max: 31827 Err:     0 (0.00%)
summary + 316200 in 00:00:30 = 10541.8/s Avg:   387 Min:     0 Max: 63556 Err:     0 (0.00%) Active: 4000 Started: 4000 Finished: 0
summary = 1566303 in 00:02:26 = 10695.3/s Avg:   290 Min:     0 Max: 63556 Err:     0 (0.00%)
summary + 312100 in 00:00:30 = 10403.0/s Avg:   384 Min:     0 Max: 63661 Err:     0 (0.00%) Active: 4000 Started: 4000 Finished: 0
summary = 1878403 in 00:02:56 = 10645.6/s Avg:   306 Min:     0 Max: 63661 Err:     0 (0.00%)
summary + 307900 in 00:00:30 = 10262.6/s Avg:   383 Min:     0 Max: 31917 Err:     0 (0.00%) Active: 4000 Started: 4000 Finished: 0
summary = 2186303 in 00:03:26 = 10589.9/s Avg:   317 Min:     0 Max: 63661 Err:     0 (0.00%)
summary + 297500 in 00:00:30 = 9914.7/s Avg:   395 Min:     0 Max: 127296 Err:     2 (0.00%) Active: 4000 Started: 4000 Finished: 0
summary = 2483803 in 00:03:56 = 10504.2/s Avg:   326 Min:     0 Max: 127296 Err:     2 (0.00%)
summary + 306000 in 00:00:30 = 10193.9/s Avg:   383 Min:     0 Max: 127265 Err:    20 (0.01%) Active: 4000 Started: 4000 Finished: 0
summary = 2789803 in 00:04:26 = 10469.3/s Avg:   332 Min:     0 Max: 127296 Err:    22 (0.00%)
summary + 314200 in 00:00:30 = 10483.1/s Avg:   389 Min:     0 Max: 127211 Err:     3 (0.00%) Active: 4000 Started: 4000 Finished: 0
summary = 3104003 in 00:04:56 = 10470.7/s Avg:   338 Min:     0 Max: 127296 Err:    25 (0.00%)
summary +  42788 in 00:00:29 = 1478.5/s Avg:   749 Min:     0 Max: 127326 Err:    43 (0.10%) Active: 0 Started: 4000 Finished: 4000
summary = 3146791 in 00:05:25 = 9670.9/s Avg:   344 Min:     0 Max: 127326 Err:    68 (0.00%)
Tidying up remote @ Wed Jan 11 03:26:58 UTC 2017 (1484105218946)

在测试过程中发生了一些错误.我查看了log.jtl文件,发现它们的ConnectException/Connection超时.

A few errors happened during the test. I looked at my log.jtl file and found they're ConnectException/Connection timed out.

一些消息如下:

1484105011292,127254,HTTP Request,Non HTTP response code: java.net.ConnectException,Non HTTP response message: Connection timed out,jmeter-users 1-1708,text,false,,2111,0,2000,2000,0,0,127254
1484105011302,127244,HTTP Request,Non HTTP response code: java.net.ConnectException,Non HTTP response message: Connection timed out,jmeter-users 1-1897,text,false,,2111,0,2000,2000,0,0,127244
1484105138314,234,HTTP Request,200,,jmeter-users 1-80,text,true,,11369,183,2000,2000,234,0,0
1484105138279,269,HTTP Request,200,,jmeter-users 1-238,text,true,,11369,183,2000,2000,269,0,0
1484105011293,127253,HTTP Request,Non HTTP response code: java.net.ConnectException,Non HTTP response message: Connection timed out,jmeter-users 1-1565,text,false,,2111,0,2000,2000,0,0,127253
1484105138314,234,HTTP Request,200,,jmeter-users 1-1634,text,true,,11369,183,2000,2000,234,0,0
1484105138315,233,HTTP Request,200,,jmeter-users 1-1550,text,true,,11369,183,2000,2000,233,0,0
1484105138315,233,HTTP Request,200,,jmeter-users 1-1017,text,true,,11369,183,2000,2000,233,0,0

我已经配置了tomcat和测试计划的超时时间,并将它们设置为300,000.
我的问题是为什么会发生此错误,以及如何配置以提高tomcat的吞吐量.

I've configured the timeout of tomcat and test plan, and set them to 300,000.
My question is why this error happened and how to configure to improve the throughput of tomcat.

编辑(新错误):
添加一个从服务器后,在日志文件中出现了以下错误(SocketException/Connection reset):

EDIT(new error):
After adding a slave, I got a few following error in the log file(SocketException/Connection reset):

1484117548733,69717,HTTP Request,Non HTTP response code: java.net.SocketException,Non HTTP response message: Connection reset,jmeter-users 1-1749,text,false,,2629,0,34,34,0,0,118

推荐答案

我认为您正在超载 Tomcat服务器.

I think you are overloading the tomcat server.

  1. ConnectException :当所有可能的请求处理线程(映射为线程数和连接数)正在忙于处理现有请求,则这些请求将被保留在队列中(其长度在acceptCount参数中配置).如果请求没有机会,则会发生超时并引发connectException.
  2. SocketException : (accountCount)的队列已满,那么后续请求将立即被拒绝.
  1. ConnectException: Observed when all possible request processing threads (mapped to thread count & connection count) are busy serving the existing requests, then the requests will be kept in queue (of length configured in acceptCount parameter). If the requests did not get the chance, then timeout will occur and raise connectException.
  2. SocketException: Observed when the queue (of acceptCount) is full, then subsequent requests will be immediately rejected.

在生成2000个vuser的负载(在每个从属服务器上)时,服务器端也必须有可用的支持线程.

As you are generating a load of 2000 vusers (on each slave), there must be supporting threads available on the server end also.

Tomcat配置:

  1. maxConnections:服务器在任何给定时间将接受和处理的最大连接数.达到此数量后,服务器将接受但不处理另一个连接
  2. maxThreads:此连接器将创建的请求处理线程的最大数量,因此确定了可以处理的同时请求的最大数量.如果未指定,则此属性设置为200.
  3. acceptCount:当所有可能的请求处理线程都在使用中时,传入连接请求的最大队列长度.队列已满时收到的任何请求都将被拒绝.默认值为100.
  1. maxConnections: The maximum number of connections that the server will accept and process at any given time. When this number has been reached, the server will accept, but not process, one further connection
  2. maxThreads: The maximum number of request processing threads to be created by this Connector, which therefore determines the maximum number of simultaneous requests that can be handled. If not specified, this attribute is set to 200.
  3. acceptCount: The maximum queue length for incoming connection requests when all possible request processing threads are in use. Any requests received when the queue is full will be refused. The default value is 100.

这些是调整tomcat以获得更好性能时要考虑的重要参数.

These are important parameters to be considered while tweaking tomcat for better performance.

注意:仅增加数量/线程数并不会带来更好的性能,因为这完全取决于硬件功能.因此,就像走错了路,您需要在其中找到适合给定硬件的最佳组合和最佳性能.

Note: Just increasing the numbers/threads won't result in better performance, as it completely depends on the hardware capabilities. so, it is like trail and error, where you need find the best combination with optimal performance that suits the given hardware.

这篇关于在Jmeter的log.jtl文件中,此消息java.net.ConnectException/Connection超时意味着什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆