JMeter: java.net.SocketException: Connection reset

送分小仙女□ 提交于 2019-12-11 13:17:58

问题


Once a Login script is executed with few user, I don't see connection reset problem, whereas, when the same is run 100 users, "java.net.SocketException: Connection reset" starts throwing for very first link.

What I don't understand is if there is connection problem, then it should even show the same error for single or few users as well.


回答1:


This means that your server is rejecting connections because it is either overloaded or misconfigured.

It is regular that you don't face it with 1 user and face it with 100, this is typically what load testing brings, ie simulate traffic on your server




回答2:


It might be the case described in Connection Reset since JMeter 2.10 ? wiki page.

If you are absolutely sure that your server is not overloaded and is configured to accept 100+ connections (defaults are good for development, not for production, they need to be tweaked) you can try work it around as follows:

  1. In user.properties file add the next 2 lines:

    httpclient4.retrycount=1
    hc.parameters.file=hc.parameters
    
  2. In hc.parameters file add the following line:

    http.connection.stalecheck$Boolean=true
    

    Both files live in JMeter's bin folder.

  3. You need to restart JMeter to pick the properties up.

Above instructions are applicable for HttpClient4 implementation, make sure you use it, the fastest and the easiest way to set HttpClient4 implementation for all the HTTP Request samplers is using HTTP Request Defaults



来源:https://stackoverflow.com/questions/34836008/jmeter-java-net-socketexception-connection-reset

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!