Java 在 jmeter 中收到错误“响应代码:非 HTTP 响应代码:org.apache.http.conn.HttpHostConnectException”

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/25664979/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-11 00:52:44  来源:igfitidea点击:

Getting an error "Response code: Non HTTP response code: org.apache.http.conn.HttpHostConnectException" in jmeter

javaconnectionjmeter

提问by Shrikant Borse

I am executing load test using JMeter where users are suppose to do Launch--Login--clk dashboard Page--clk landing page(the page which come after login i.e. home page) where clk dashboardand clk landing pageare repetitive action for 5 times.

我正在使用 JMeter 执行负载测试,用户应该在其中执行Launch-- Login-- clk 仪表板页面-- clk 登录页面(登录后出现的页面,即主页),其中clk 仪表板clk 登录页面是 5 的重复操作次。

Till 30 users I am not getting any error when i increased users load i am start getting an error as

直到 30 个用户,当我增加用户负载时,我没有收到任何错误,我开始收到错误消息

Response code: Non HTTP response code: org.apache.http.conn.HttpHostConnectException Response message: Non HTTP response message: Connection to https://stage.ideas.comrefused

Response headers:


HTTPSampleResult fields:
ContentType: 
DataEncoding: null

响应代码:非 HTTP 响应代码:org.apache.http.conn.HttpHostConnectException 响应消息:非 HTTP 响应消息:连接到https://stage.ideas.com 被拒绝

Response headers:


HTTPSampleResult fields:
ContentType: 
DataEncoding: null

in sample results.

在样本结果中。

Could any one suggest why I am getting this error ? Sometimes it works for 100 users and sometimes I am getting an error.

任何人都可以建议我为什么会收到此错误?有时它适用于 100 个用户,有时我收到错误。

Thanks a lot in advance.

非常感谢。

采纳答案by Simone Gianni

You are getting connection refused, this means that JMeter is not able to connect to your server to perform the required test.

您的连接被拒绝,这意味着 JMeter 无法连接到您的服务器以执行所需的测试。

This can happen because :

这可能是因为:

  1. The server is not listening to the port anymore, like it crashed
  2. The internet connection went down, on your side, server side, or in the middle
  3. Some firewall or proxy or similar component between you and the server is denying connection
  1. 服务器不再侦听端口,就像它崩溃一样
  2. Internet 连接出现故障,在您这边、服务器端或中间
  3. 您与服务器之间的某些防火墙或代理或类似组件拒绝连接

Since you're running tests, and spawning a lot of connections from the same ip to the server, I would check the number 3 first, meaning some firewall or proxy is limiting your activity to the server for excessive load or security reasons.

由于您正在运行测试,并从同一个 IP 到服务器产生大量连接,我将首先检查数字 3,这意味着某些防火墙或代理出于过度负载或安全原因将您的活动限制在服务器上。