原因:windows提供给TCP/IP链接的端口为 1024-5000,并且要四分钟(默认时间长度)来回收它们,就导致我们在短时间内跑大量的请求时,无端口可用,所以导致如上报错。
这里需要对windows负载机的参数进行调优,参见文章:Windows压测负载机调优_饭特稀cn-CSDN博客
如果负载机注册表参数已经调优,仍然报错,可以尝试如下方法:
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:
-
In user.properties file add the next 2 lines:
httpclient4.retrycount=1 hc.parameters.file=hc.parameters
-
In hc.parameters file add the following line:
http.connection.stalecheck$Boolean=true
Both files live in JMeter's bin folder.
- 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