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

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

原因: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

这是正常的?2025-09-10 10:25:57,266 INFO o.j.r.JARSourceHTTP: Found cached repo 2025-09-10 10:25:57,394 INFO o.j.r.PluginManager: Plugins Status: [jpgc-graphs-basic=2.0, jpgc-functions=2.2, jpgc-casutg=3.1.1, jpgc-dummy=0.4, jpgc-ffw=2.0, jpgc-fifo=0.2, jpgc-perfmon=2.1, jpgc-plugins-manager=1.10, jpgc-tst=2.6, jpgc-udp=0.4, jmeter-core=5.6.3, jmeter-ftp=5.6.3, jmeter-http=5.6.3, jmeter-jdbc=5.6.3, jmeter-jms=5.6.3, jmeter-junit=5.6.3, jmeter-java=5.6.3, jmeter-ldap=5.6.3, jmeter-mail=5.6.3, jmeter-mongodb=5.6.3, jmeter-native=5.6.3, jmeter-tcp=5.6.3, jmeter-components=5.6.3, jpgc-standard=2.0] 2025-09-10 10:25:57,394 INFO o.j.r.PluginManagerMenuItem: Plugins Manager has upgrades: [jpgc-plugins-manager] 2025-09-10 10:28:36,500 INFO o.a.j.s.FileServer: Default base='C:\Users\10433' 2025-09-10 10:28:36,501 INFO o.a.j.s.FileServer: Set new base='C:\Users\10433' 2025-09-10 10:28:36,567 INFO o.a.j.s.SaveService: Testplan (JMX) version: 2.2. Testlog (JTL) version: 2.2 2025-09-10 10:28:36,571 INFO o.a.j.s.SaveService: Using SaveService properties file encoding UTF-8 2025-09-10 10:28:36,572 INFO o.a.j.s.SaveService: Using SaveService properties version 5.0 2025-09-10 10:28:38,272 INFO o.a.j.e.StandardJMeterEngine: Running the test! 2025-09-10 10:28:38,273 INFO o.a.j.s.SampleEvent: List of sample_variables: [] 2025-09-10 10:28:38,273 INFO o.a.j.s.SampleEvent: List of sample_variables: [] 2025-09-10 10:28:38,273 INFO o.a.j.e.u.CompoundVariable: Note: Function class names must contain the string: '.functions.' 2025-09-10 10:28:38,273 INFO o.a.j.e.u.CompoundVariable: Note: Function class names must not contain the string: '.gui.' 2025-09-10 10:28:38,413 INFO o.a.j.r.ClassFinder: Will scan jar C:\mySoft\program\apache-jmeter-5.6.3\lib\ext\jmeter-plugins-manager-1.11.jar with filter ExtendsClassFilter [parents=[interface org.apache.jmeter.functions.Function], inner=false, contains=null, notContains=null]. Consider exposing JMeter plugins via META-INF/services, and add JMeter-Skip-Class-Scanning=true manifest attribute so JMeter can skip classfile scanning 2025-09-10 10:28:38,414 INFO o.a.j.r.ClassFinder: Will scan jar C:\mySoft\program\apache-jmeter-5.6.3\lib\ext\jmeter-plugins-dummy-0.4.jar with filter ExtendsClassFilter [parents=[interface org.apache.jmeter.functions.Function], inner=false, contains=null, notContains=null]. Consider exposing JMeter plugins via META-INF/services, and add JMeter-Skip-Class-Scanning=true manifest attribute so JMeter can skip classfile scanning 2025-09-10 10:28:38,415 INFO o.a.j.r.ClassFinder: Will scan jar C:\mySoft\program\apache-jmeter-5.6.3\lib\ext\jmeter-plugins-ffw-2.0.jar with filter ExtendsClassFilter [parents=[interface org.apache.jmeter.functions.Function], inner=false, contains=null, notContains=null]. Consider exposing JMeter plugins via META-INF/services, and add JMeter-Skip-Class-Scanning=true manifest attribute so JMeter can skip classfile scanning 2025-09-10 10:28:38,415 INFO o.a.j.r.ClassFinder: Will scan jar C:\mySoft\program\apache-jmeter-5.6.3\lib\ext\jmeter-plugins-graphs-basic-2.0.jar with filter ExtendsClassFilter [parents=[interface org.apache.jmeter.functions.Function], inner=false, contains=null, notContains=null]. Consider exposing JMeter plugins via META-INF/services, and add JMeter-Skip-Class-Scanning=true manifest attribute so JMeter can skip classfile scanning 2025-09-10 10:28:38,416 INFO o.a.j.r.ClassFinder: Will scan jar C:\mySoft\program\apache-jmeter-5.6.3\lib\ext\jmeter-plugins-casutg-3.1.1.jar with filter ExtendsClassFilter [parents=[interface org.apache.jmeter.functions.Function], inner=false, contains=null, notContains=null]. Consider exposing JMeter plugins via META-INF/services, and add JMeter-Skip-Class-Scanning=true manifest attribute so JMeter can skip classfile scanning 2025-09-10 10:28:38,416 INFO o.a.j.r.ClassFinder: Will scan jar C:\mySoft\program\apache-jmeter-5.6.3\lib\ext\jmeter-plugins-manager-1.10.jar with filter ExtendsClassFilter [parents=[interface org.apache.jmeter.functions.Function], inner=false, contains=null, notContains=null]. Consider exposing JMeter plugins via META-INF/services, and add JMeter-Skip-Class-Scanning=true manifest attribute so JMeter can skip classfile scanning 2025-09-10 10:28:38,417 INFO o.a.j.r.ClassFinder: Will scan jar C:\mySoft\program\apache-jmeter-5.6.3\lib\ext\jmeter-plugins-functions-2.2.jar with filter ExtendsClassFilter [parents=[interface org.apache.jmeter.functions.Function], inner=false, contains=null, notContains=null]. Consider exposing JMeter plugins via META-INF/services, and add JMeter-Skip-Class-Scanning=true manifest attribute so JMeter can skip classfile scanning 2025-09-10 10:28:38,418 INFO o.a.j.r.ClassFinder: Will scan jar C:\mySoft\program\apache-jmeter-5.6.3\lib\ext\jmeter-plugins-perfmon-2.1.jar with filter ExtendsClassFilter [parents=[interface org.apache.jmeter.functions.Function], inner=false, contains=null, notContains=null]. Consider exposing JMeter plugins via META-INF/services, and add JMeter-Skip-Class-Scanning=true manifest attribute so JMeter can skip classfile scanning 2025-09-10 10:28:38,418 INFO o.a.j.r.ClassFinder: Will scan jar C:\mySoft\program\apache-jmeter-5.6.3\lib\ext\jmeter-plugins-fifo-0.2.jar with filter ExtendsClassFilter [parents=[interface org.apache.jmeter.functions.Function], inner=false, contains=null, notContains=null]. Consider exposing JMeter plugins via META-INF/services, and add JMeter-Skip-Class-Scanning=true manifest attribute so JMeter can skip classfile scanning 2025-09-10 10:28:38,421 INFO o.a.j.r.ClassFinder: Will scan jar C:\mySoft\program\apache-jmeter-5.6.3\lib\ext\jmeter-plugins-tst-2.6.jar with filter ExtendsClassFilter [parents=[interface org.apache.jmeter.functions.Function], inner=false, contains=null, notContains=null]. Consider exposing JMeter plugins via META-INF/services, and add JMeter-Skip-Class-Scanning=true manifest attribute so JMeter can skip classfile scanning 2025-09-10 10:28:38,422 INFO o.a.j.r.ClassFinder: Will scan jar C:\mySoft\program\apache-jmeter-5.6.3\lib\ext\jmeter-plugins-udp-0.4.jar with filter ExtendsClassFilter [parents=[interface org.apache.jmeter.functions.Function], inner=false, contains=null, notContains=null]. Consider exposing JMeter plugins via META-INF/services, and add JMeter-Skip-Class-Scanning=true manifest attribute so JMeter can skip classfile scanning 2025-09-10 10:28:38,425 INFO o.a.j.g.u.JMeterMenuBar: setRunning(true, *local*) 2025-09-10 10:28:38,479 INFO o.a.j.e.StandardJMeterEngine: Starting ThreadGroup: 1 : 线程组 2025-09-10 10:28:38,479 INFO o.a.j.e.StandardJMeterEngine: Starting 1 threads for group 线程组. 2025-09-10 10:28:38,479 INFO o.a.j.e.StandardJMeterEngine: Thread will continue on error 2025-09-10 10:28:38,480 INFO o.a.j.t.ThreadGroup: Starting thread group... number=1 threads=1 ramp-up=1 delayedStart=false 2025-09-10 10:28:38,482 INFO o.a.j.t.ThreadGroup: Started thread group number 1 2025-09-10 10:28:38,482 INFO o.a.j.e.StandardJMeterEngine: All thread groups have been started 2025-09-10 10:28:38,484 INFO o.a.j.t.JMeterThread: Thread started: 线程组 1-1 2025-09-10 10:28:38,487 INFO o.a.j.s.SampleResult: Note: Sample TimeStamps are START times 2025-09-10 10:28:38,487 INFO o.a.j.s.SampleResult: sampleresult.default.encoding is set to UTF-8 2025-09-10 10:28:38,487 INFO o.a.j.s.SampleResult: sampleresult.useNanoTime=true 2025-09-10 10:28:38,487 INFO o.a.j.s.SampleResult: sampleresult.nanoThreadSleep=5000 2025-09-10 10:28:39,506 INFO o.a.j.t.JMeterThread: Thread is done: 线程组 1-1 2025-09-10 10:28:39,506 INFO o.a.j.t.JMeterThread: Thread finished: 线程组 1-1 2025-09-10 10:28:39,507 INFO o.a.j.e.StandardJMeterEngine: Notifying test listeners of end of test 2025-09-10 10:28:39,507 INFO o.a.j.g.u.JMeterMenuBar: setRunning(false, *local*) 2025-09-10 10:29:26,611 INFO o.a.j.e.StandardJMeterEngine: Running the test! 2025-09-10 10:29:26,611 INFO o.a.j.s.SampleEvent: List of sample_variables: [] 2025-09-10 10:29:26,612 INFO o.a.j.g.u.JMeterMenuBar: setRunning(true, *local*) 2025-09-10 10:29:26,686 INFO o.a.j.e.StandardJMeterEngine: Starting ThreadGroup: 1 : 线程组 2025-09-10 10:29:26,686 INFO o.a.j.e.StandardJMeterEngine: Starting 1 threads for group 线程组. 2025-09-10 10:29:26,686 INFO o.a.j.e.StandardJMeterEngine: Thread will continue on error 2025-09-10 10:29:26,686 INFO o.a.j.t.ThreadGroup: Starting thread group... number=1 threads=1 ramp-up=1 delayedStart=false 2025-09-10 10:29:26,686 INFO o.a.j.t.ThreadGroup: Started thread group number 1 2025-09-10 10:29:26,686 INFO o.a.j.e.StandardJMeterEngine: All thread groups have been started 2025-09-10 10:29:26,687 INFO o.a.j.t.JMeterThread: Thread started: 线程组 1-1 2025-09-10 10:29:27,689 INFO o.a.j.t.JMeterThread: Thread is done: 线程组 1-1 2025-09-10 10:29:27,690 INFO o.a.j.t.JMeterThread: Thread finished: 线程组 1-1 2025-09-10 10:29:27,690 INFO o.a.j.e.StandardJMeterEngine: Notifying test listeners of end of test 2025-09-10 10:29:27,690 INFO o.a.j.g.u.JMeterMenuBar: setRunning(false, *local*)
最新发布
09-11
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值