我正在使用下面的web服务器。下面是我的下拖曳子系统配置:
<subsystem xmlns="urn:jboss:domain:undertow:1.1">
<buffer-cache name="default"/>
<server name="default-server">
<http-listener name="default" socket-binding="http"/>
<host name="default-host" alias="localhost">
<location name="/" handler="welcome-content"/>
<filter-ref name="limit-connections"/>
<filter-ref name="server-header"/>
<filter-ref name="x-powered-by-header"/>
</host>
</server>
<servlet-container name="default">
<jsp-config/>
</servlet-container>
<handlers>
<file name="welcome-content" path="${jboss.home.dir}/welcome-content"/>
</handlers>
<filters>
<connection-limit name="limit-connections" max-concurrent-requests="15000" queue-size="1000"/>
<response-header name="server-header" header-name="Server" header- value="WildFly/8"/>
<response-header name="x-powered-by-header" header-name="X-Powered-By" header-value="Undertow/1"/>
</filters>
</subsystem>IO子系统配置(硬件:4核心处理器和16 gb RAM):
<subsystem xmlns="urn:jboss:domain:io:1.1">
<worker name="default" task-keepalive="300" io-threads="8" task-max-threads="64"/>
<buffer-pool name="default"/>
</subsystem>我的测试:
是否知道如何为生成的请求获取0%的故障率。
发布于 2014-08-27 16:59:01
如果拒绝的连接意味着向下拖曳被拒绝的连接,那么它将不会登录到server.log中,可能是在access.log中,但不确定。
您应该尝试慢慢提高JMeter,以查看开始错误的限制。
此外,我建议您增加迭代次数,因为这种模拟似乎不现实。你想复制什么行为?
修复方法是在IO子系统中增加一些值:
发布于 2014-09-14 20:23:19
我和安德托也有同样的问题。当我使用java客户端访问服务器时,大约30%的连接被拒绝。
当我使用ab.exe (ApacheBench)时,即使我使用了1000个并发连接(这似乎触及了Windows7的限制),我还是拒绝了0%。
奇怪的是,只有当我使用打开连接的java客户机时,才会拒绝连接。我使用java打开了800个并发连接,其中许多被拒绝。即使套接字超时为1000 of,我也尝试了这个测试。下面是我的java客户机中打开连接的片段:
URL url = new URL("http://localhost/testWeb/test2");
URLConnection testConnection = url.openConnection();
testConnection.setConnectTimeout(1000);
testConnection.setReadTimeout(1000);
InputStream is = testConnection.getInputStream();正如我提到的,奇怪的是,ab.exe测试运行良好:
c:\work\dotera\servers\apache\bin>ab -n 10000 -c 1000 http://localhost:8080/testWeb/test
This is ApacheBench, Version 2.0.40-dev <$Revision: 1.146 $> apache-2.0
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright 2006 The Apache Software Foundation, http://www.apache.org/
Benchmarking localhost (be patient)
Completed 1000 requests
Completed 2000 requests
Completed 3000 requests
Completed 4000 requests
Completed 5000 requests
Completed 6000 requests
Completed 7000 requests
Completed 8000 requests
Completed 9000 requests
Finished 10000 requests
Server Software: WildFly/8
Server Hostname: localhost
Server Port: 8080
Document Path: /testWeb/test
Document Length: 108 bytes
Concurrency Level: 1000
Time taken for tests: 5.302303 seconds
Complete requests: 10000
Failed requests: 0
Write errors: 0
Total transferred: 3620000 bytes
HTML transferred: 1080000 bytes
Requests per second: 1885.97 [#/sec] (mean)
Time per request: 530.230 [ms] (mean)
Time per request: 0.530 [ms] (mean, across all concurrent requests)
Transfer rate: 666.69 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 12.2 0 998
Processing: 56 478 316.6 320 1319
Waiting: 9 320 327.2 198 1291
Total: 56 479 316.7 320 1319
Percentage of the requests served within a certain time (ms)
50% 320
66% 326
75% 841
80% 847
90% 893
95% 1302
98% 1310
99% 1314
100% 1319 (longest request)
c:\work\dotera\servers\apache\bin>我认为这可能有助于了解问题的本质。
还需要提到的一点是,使用java客户端再次运行相同的测试,而node.js客户机和ab.exe提供0%的故障。
==========================================================================
我做了另一个测试。我更改的是将nginx放在通配符前面,以更好地理解请求。java测试再次抛出"java.net.ConnectException: Connection : connect“,这里有趣的是,nginx根本不注册失败的请求。
下面是一个场景:
这给了我这样的想法:在java中从同一台机器打开客户端套接字有一些问题。也许没有潜在的问题,只是客户端失败了。
对我来说,神秘的是为什么在nodejs上运行的相同测试没有失败,但是在一个纯nodejs HelloWorld上运行了几次之后,它失败了,其中包含了"java.net.ConnectException: Connection : connect“。
我的结论是,在java下运行的客户机存在问题。安德托没有问题(野生蝇/8.1)
https://stackoverflow.com/questions/25498841
复制相似问题