gpt4 book ai didi

jmeter - 为什么通过验证日志与服务器时间相比,Jmeter 响应时间不准确

转载 作者:行者123 更新时间:2023-12-05 04:04:42 27 4
gpt4 key购买 nike

我的查询是当我完成性能测试并获得结果文件时,我可以看到 Jmeter 响应时间和服务器响应时间之间存在差异。我通过检查服务器日志验证了服务器响应时间。我也没有在结果文件中写入任何额外的元素。我能解释一下为什么 Jmeter 显示的响应时间总是比实际响应时间高吗

最佳答案

你有没有想过网络?根据JMeter glossary :

Elapsed time. JMeter measures the elapsed time from just before sending the request to just after the last response has been received. JMeter does not include the time needed to render the response, nor does JMeter process any client code, for example Javascript.

Latency. JMeter measures the latency from just before sending the request to just after the first response has been received. Thus the time includes all the processing needed to assemble the request as well as assembling the first part of the response, which in general will be longer than one byte. Protocol analysers (such as Wireshark) measure the time when bytes are actually sent/received over the interface. The JMeter time should be closer to that which is experienced by a browser or other application client.

Connect Time. JMeter measures the time it took to establish the connection, including SSL handshake. Note that connect time is not automatically subtracted from latency. In case of connection error, the metric will be equal to the time it took to face the error, for example in case of Timeout, it should be equal to connection timeout.

所以我的期望是服务器只测量处理请求和响应所需的时间,而 JMeter 测量所有端到端事务:

  • 建立连接(特别是初始 SSL Handshake 可能很长)
  • 向服务器发送数据包
  • 此处服务器开始测量
  • 服务器处理请求
  • 此处服务器停止测量
  • 等待第一个数据包到来(延迟)
  • 等待最后一个数据包的到来(耗用时间)

请求来回所需时间can really matter ,例如,如果您的路由器出现故障或负载均衡器配置不当,即使实际服务器响应时间很短,用户体验也不会流畅。

关于jmeter - 为什么通过验证日志与服务器时间相比,Jmeter 响应时间不准确,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52197854/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com