问题描述
我已经在linux和Apache Tomcat 7.0.42中部署了Java EE应用程序
I have deployed a Java EE application in linux and Apache Tomcat 7.0.42
当我使用JMeter对100个用户进行负载测试(并发100个线程请求)时,一切都正常运行
Everything works fine when I load test for 100 users using JMeter(concurrent 100 threads requests)
但是,一旦我将用户(或线程数)更改为1000个服务器,它就会被阻塞,并且它会在〜600之后为所有请求给出连接被拒绝"错误.
But as soon as I change the users(or number of threads) to 1000 server is choked and it gives "Connection refused" error for all the requests after ~600.
我已经在应用程序中进行了所有的微调,它现在更多的是静态网页,即使这样它也会返回错误.
I have done all fine tuning in the application and it is more of of a static web page now, even then it comes back with error.
服务器配置:Ubuntu,8个vCPU/32 GB RAM/960GB HD
Server Configuration: Ubuntu, 8 vCPU / 32 GB RAM / 960 GB HD
PS:同一应用程序在AWS(Amazon Web Services)中运行良好,因此您可以排除运行JMeter(client)的计算机出现任何问题
PS: The same application works well in AWS(Amazon Web Services), so you can rule out any problem with my machine running JMeter(client)
org.apache.http.conn.HttpHostConnectException: Connection to http://a.b.c.d:8080 refused
at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:190)
at org.apache.http.impl.conn.ManagedClientConnectionImpl.open(ManagedClientConnectionImpl.java:294)
at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:645)
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:480)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:906)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:805)
at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:286)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:62)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1088)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1077)
at org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:428)
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:256)
at java.lang.Thread.run(Unknown Source)
Caused by: java.net.ConnectException: Connection timed out: connect
at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at org.apache.http.conn.scheme.PlainSocketFactory.connectSocket(PlainSocketFactory.java:127)
at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:180)
... 12 more
推荐答案
尝试在server.xml
中调整http连接器的maxThreads
和acceptCount
属性:
Try adjusting the maxThreads
and acceptCount
attributes of the http connector in server.xml
:
参考: http://tomcat.apache.org/tomcat- 7.0-doc/config/http.html
这篇关于使用JMeter与1000位用户进行负载测试时,Apache Tomcat Connection Refused错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!