[英]Getting an error “Response code: Non HTTP response code: org.apache.http.conn.HttpHostConnectException” in jmeter
I am running a Load Test on my.Net web application using Jmeter.我正在使用 Jmeter 在 my.Net web 应用程序上运行负载测试。 Application Process: Launch - Login - Start Test - Answer Q&A - Home Page - Logout
申请流程:启动-登录-开始测试-答疑-首页-注销
Till 500 users or sometimes 750, the test is running successfully.直到 500 个用户或有时 750 个用户,测试才成功运行。 But when I increase the load I get an Error:
但是当我增加负载时,我得到一个错误:
Non HTTP response code: org.apache.http.conn.HttpHostConnectException/Non HTTP response message:
Connect to www.demoname.com:80 [www.demoname.com\/11.111.111.111] failed: Connection timed out: connect
'11.111.111.111' - is my Server IP address '11.111.111.111' - 是我的服务器 IP 地址
I have increased the jmeter.batch file Heap memory to HEAP=-Xms1g -Xmx4g -XX:MaxMetaspaceSize=256m我已将 jmeter.batch 文件堆 memory 增加到 HEAP=-Xms1g -Xmx4g -XX:MaxMetaspaceSize=256m
Apache Jmeter version - 5.1.1r1855137 Apache Jmeter 版本 - 5.1.1r1855137
Java Version - 1.8.0_221 Java 版本 - 1.8.0_221
Server Configuration: Standard D4 v2 (8 vcpus, 28 GiB memory)服务器配置:标准 D4 v2(8 vcpus,28 GiB 内存)
How can I get rid of this error?我怎样才能摆脱这个错误?
HttpHostConnectException is basically an instance of a ConnectException which: HttpHostConnectException基本上是ConnectException的一个实例,它:
Signals that an error occurred while attempting to connect a socket to a remote address and port.
表示尝试将套接字连接到远程地址和端口时发生错误的信号。 Typically, the connection was refused remotely (eg, no process is listening on the remote address/port).
通常,连接被远程拒绝(例如,没有进程正在侦听远程地址/端口)。
So most probably the error is on your server side because JMeter attempts to establish the connection and fails to do this within the bounds of the defined timeout所以很可能错误在您的服务器端,因为 JMeter 尝试建立连接并且未能在定义的超时范围内执行此操作
If you're absolutely sure that your application works normally you can increase connect timeout in HTTP Request Defaults如果您绝对确定您的应用程序正常工作,您可以在HTTP Request Defaults中增加连接超时
However a better idea would be getting to the bottom of the error and fixing it on server side, the most possible reasons are in:然而,一个更好的主意是找出错误的根源并在服务器端修复它,最可能的原因是:
your application infrastructure is not properly configured, make sure to double check if your backend is properly tuned for high loads including IIS and MSSQL您的应用程序基础架构配置不正确,请务必仔细检查您的后端是否针对高负载进行了适当调整,包括IIS和MSSQL
it might be the case your application code is problematic, ie it cannot handle more than X users due to poorly implemented algorithms.这可能是您的应用程序代码有问题的情况,即由于算法实施不善,它不能处理超过 X 个用户。 Consider using a profiler tool like NProfiler or dotTrace to detect the most expensive functions, largest objects, etc.
考虑使用像NProfiler或dotTrace这样的分析器工具来检测最昂贵的函数、最大的对象等。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.