开发者

MongoDB java.net.ConnectException: Connection refused

开发者 https://www.devze.com 2023-01-25 14:18 出处:网络
I have problem with used MongoDB I am testing a web aplication use Jmeter test. When set up a big load, on the web application, it is right.

I have problem with used MongoDB

I am testing a web aplication use Jmeter test.

When set up a big load, on the web application, it is right. When set up a low load but many users, it is beginning exception..

java.net.ConnectException: Connection refused: connect at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.PlainSocketImpl.doConnect(Unknown Source) at java.net.PlainSocketImpl.connectToAddress(Unknown Source) at java.net.PlainSocketImpl.connect(Unknown Source) at java.net.SocksSocketImpl.connect(Unknown Source) at java.net.Socket.connect(Unknown Source) at sun.net.NetworkClient.doConnect(Unknown Source) at sun.net.www.http.HttpClient.openServer(Unknown Source) at sun.net.www.http.HttpClient.openServer(Unknown Source) at sun.net.www.http.HttpClient.(Unknown Source) at sun.net.www.http.HttpClient.New(Unknown Source) at sun.net.www.http.HttpClient.New(Unknown Source) at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source) at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source) at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source) at org.apache.jmeter.protocol.http.sampler.HTTPSampler.sample(HTTPSampler.java:483) at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:965) at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:951) at org.apache.jmeter开发者_如何转开发.threads.JMeterThread.process_sampler(JMeterThread.java:348) at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:243) at java.lang.Thread.run(Unknown Source)

Tell me please, why..? (I use MongoDB, Tomcat, Java)Thanks..


This is the type of error you should expect to see when load testing any web application with a tool like JMeter, and tells you that you're hitting the upper limit of transactions that the app can support... and this is where you'd do some tweaking of the settings to get better results.

The error message is saying that there are too many HTTP connections going at once and Tomcat is overwhelmed. I'm not sure which version of Tomcat you're on, but it looks like the default for Tomcat 6 is to queue up to 100 requests, then refuse any after that, and maxes out at 200 threads. Try increasing the "acceptCount" or "maxThreads" and see if that helps.

You may also try retagging the question, since this is a broader problem that affects more than just MongoDB apps... and you should get more replies that way. ;)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号