java.net.ConnectException: Connection refused: connect
at java.net.DualStackPlainSocketImpl.connect0(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:121)
at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:180)
at org.apache.jmeter.protocol.http.sampler.hc.ManagedClientConnectionImpl.open(ManagedClientConnectionImpl.java:318)
at org.apache.jmeter.protocol.http.sampler.MeasuringConnectionManager$MeasuredConnection.open(MeasuringConnectionManager.java:114)
at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:610)
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:445)
at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:835)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)
at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.executeRequest(HTTPHC4Impl.java:697)
at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:455)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:74)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1189)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1178)
at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:490)
at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:416)
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:250)
at java.lang.Thread.run(Unknown Source)
tomcat压测正常,说明问题应出在nainx负载均衡上,求指教
先查看下nginx日志记录。
nginx没有错误日志
@张亚南: 是没有配置日志记录还是没有错误记录?
如果nginx的error.log 没有记录的话,说明你的nginx配置没问题。
@Shendu.cc: 配置了日志但没有错误记录。有的时候会有错误日志。如果nginx配置合理的话,为什么tomcat能处理的并发nginx却出现部分连接拒绝?
@张亚南: nginx 配置的最大连接数是多少? worker_connections;
你的并发量是多大?
@Shendu.cc: 最大连接数20480*8,并发量10000.请求的request headers也不完整
POST http://192.168.1.56:81/naire/answerGuest/test
POST data:
id=62&sex=1
[no cookies]
Request Headers:
Connection: keep-alive
Content-Type: application/x-www-form-urlencoded
压力有打过去吗 你这是本地jmeter报的错吧
一部分不过了,没过去的request headers不完整
POST http://192.168.1.56:81/naire/answerGuest/test
POST data:
id=62&sex=1
[no cookies]
Request Headers:
Connection: keep-alive
Content-Type: application/x-www-form-urlencoded
@张亚南: 少压点 会报错吗
@ycyzharry: 1000个很稳定,2000以内很少次报错,2000-5000错误请求率在50%以下,5000以上除了个别次基本都会报错,错误请求率在50-80%
@张亚南: 一台机器少压点 不超过3000 用2台机器每台3000压试试
自己解决了。nginx不支持windows更高的配置
你好,请问是怎么解决的呀?我也碰到这个问题了
@絕代風華: 建议在Linux下测试。官网说还不能很好的支持windows,http://nginx.org/en/docs/windows.html
……
Version of nginx for Windows uses the native Win32 API (not the Cygwin emulation layer). Only the select() and poll() (1.15.9) connection processing methods are currently used, so high performance and scalability should not be expected.
……
Although several workers can be started, only one of them actually does any work.……