Jmeter报错:readResponse: java.net.BindException: Address already in use: connect

当在Windows系统上进行大量HTTP请求时,由于默认的端口范围和回收时间限制,可能会遇到端口耗尽的问题。为解决此问题,可以调整Windows的TCP/IP参数以扩大端口范围和缩短回收时间,并优化JMeter配置,如在user.properties中设置httpclient4.retrycount和启用http.connection.stalecheck。如果已调优仍出错,检查是否使用了HttpClient4实现,并确保其配置正确。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

原因:windows提供给TCP/IP链接的端口为 1024-5000,并且要四分钟(默认时间长度)来回收它们,就导致我们在短时间内跑大量的请求时,无端口可用,所以导致如上报错。

这里需要对windows负载机的参数进行调优,参见文章:Windows压测负载机调优_饭特稀cn-优快云博客

如果负载机注册表参数已经调优,仍然报错,可以尝试如下方法:

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值