gpt4 book ai didi

https - jmeter中HTTPclient 3.1和HTTP client 4之间响应时间的差异

转载 作者:行者123 更新时间:2023-12-04 22:46:54 25 4
gpt4 key购买 nike

我正在使用 HTTPS 测试我的网站。当我使用默认实现时,响应时间更长。如果我使用 HTTPclient 3.1 实现,响应时间会减少。为什么 HTTPclient 4 和 HTTPclient 3.1 之间的响应时间存在差异?要使用 https 测试我的网站,我需要使用 HTTPclient 4 还是 HTTPclient 3.1 ?哪个会像在浏览器中一样为我提供确切的响应时间?

以下是我的示例测试计划,

enter image description here

最佳答案

根据 HTTP Request documentation

HTTP Request - this has an implementation drop-down box, which selects the HTTP protocol implementation to be used: Java - uses the HTTP implementation provided by the JVM. This has some limitations in comparison with the HttpClient implementations - see below. HTTPClient3.1 - uses Apache Commons HttpClient 3.1. This is no longer being developed, and support for this may be dropped in a future JMeter release. HTTPClient4 - uses Apache HttpComponents HttpClient 4.x. Blank Value - does not set implementationon HTTP Samplers, so relies on HTTP Request Defaults if present or on jmeter.httpsampler property defined in jmeter.properties The Java HTTP implementation has some limitations: There is no control over how connections are re-used. When a connection is released by JMeter, it may or may not be re-used by the same thread. The API is best suited to single-threaded usage - various settings are defined via system properties, and therefore apply to all connections. There is a bug in the handling of HTTPS via a Proxy (the CONNECT is not handled correctly). See Java bugs 6226610 and 6208335. It does not support virtual hosts.



最好用HTTPClient4实现 .

但是,如果您需要尽可能多的请求 像真正的浏览器 您需要尽可能考虑使用以下组件:
  • HTTP Request Default s 告诉 JMeter 检索所有嵌入的资源并使用 2-5 个请求的线程池(就像真实浏览器一样)
  • 使用 HTTP Cookie Manager - 模拟浏览器 cookie 并处理基于 cookie 的身份验证
  • 使用 HTTP Header Manager - 设置用户代理字符串、内容类型、接受语言等标题。
  • 使用 HTTP Cache Manager - 模拟浏览器缓存
  • 关于https - jmeter中HTTPclient 3.1和HTTP client 4之间响应时间的差异,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21644588/

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