java - org.apache.http.NoHttpResponseException:服务器地址:80 未能响应 - JMeter
问题描述
我正在 Web 应用程序上使用 Jmeter 5.2 运行负载测试。当我运行线程组时,即使线程数超过 500,我也会做一些配置 jmeter:在 user.properties 中我设置了:httpclient4.retrycount=1
hc.parameters.file=hc.parameters
在 hc.parameters 我设置了:
http.connection.stalecheck$Boolean=true
并在 Http 请求中:客户端实现 > httpClient4
org.apache.http.NoHttpResponseException: server-address:80 failed to respond
at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:141)
at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:56)
at org.apache.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:259)
at org.apache.http.impl.DefaultBHttpClientConnection.receiveResponseHeader(DefaultBHttpClientConnection.java:163)
at org.apache.http.impl.conn.CPoolProxy.receiveResponseHeader(CPoolProxy.java:157)
at org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(HttpRequestExecutor.java:273)
at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:125)
at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:272)
at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:186)
at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89)
at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)
at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.executeRequest(HTTPHC4Impl.java:850)
at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:561)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:67)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1282)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1271)
at org.apache.jmeter.threads.JMeterThread.doSampling(JMeterThread.java:627)
at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:551)
at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:490)
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:257)
at java.lang.Thread.run(Unknown Source)
知道如何解决这个问题!
解决方案
很可能您的应用程序过载,因此它无法处理 500 个并发连接,您需要检查以下内容:
- 您的应用程序服务器配置,即增加最大传入连接数
- 您在 CPU、RAM、可用网络套接字等方面的后端健康状况,可以使用JMeter PerfMon 插件来完成
- 您的应用程序配置(连接池、数据库配置等),因为它可能没有针对高负载进行适当调整
推荐阅读
- chart.js - 如何删除除零线和边框Chartjs之外的网格线?
- button - Netsuite Workflow 上的“删除按钮”操作
- neo4j - Neo4J / Cypher:如何过滤关系中具有最新日期的路径?
- css - 如何在 MD 及以下设备上应用 Bootstrap 的“文本中心”,而不是在更大的设备上?
- reactjs - 反应酶得到 undefine onMouseDown 用于 nativeEvent offsetX 和 offsetY
- angular - 如何让倒数计时器在 Angular 10 中工作
- java - 数据库树形视图
- javascript - 验证表单以检查表单字段中是否存在单词
- maven - 如何让 Maven 从 Nexus 下载但绕过它以获取外部 jar
- c - 如何在 VS Code 中执行 C 程序