gpt4 book ai didi

Jmeter - 线程组和循环 Controller 在性能方面的区别

转载 作者:行者123 更新时间:2023-12-04 18:21:16 24 4
gpt4 key购买 nike

我是 Jmeter 的新手。这是一件令我困惑的事情

我正在测试两种场景以使用 Jmeter 计算性能数字

  • 将 1 个线程组设置为循环计数设置为 50 并具有一个 https 采样器。
  • 有一个循环计数仅为 1 的线程组,而是使用循环计数设置为 50 的循环 Controller 。在这种情况下,我的 https 采样器在循环计数内。

  • 在这两种情况下,https 采样器都运行了 50 次,但我注意到了很多性能差异。
    For 1 - 100 ms ( Average of 50 calls)
    For 2 - 30 ms ( Average of 50 calls)

    问题是为什么我会看到这种差异。理想情况下,这两种情况应该给出相同的性能数字。
    还要添加我的 Jmeter 设置,我将“使用保持事件”设置为关闭,并且在 jmeter.properties 中将 https.use.cached.ssl.context 设置为 false。

    最佳答案

    你是什​​么Ramp-up在线程组级别定义 50 个循环的场景的设置?根据 documentation

    The ramp-up period tells JMeter how long to take to "ramp-up" to the full number of threads chosen. If 10 threads are used, and the ramp-up period is 100 seconds, then JMeter will take 100 seconds to get all 10 threads up and running. Each thread will start 10 (100/10) seconds after the previous thread was begun. If there are 30 threads and a ramp-up period of 120 seconds, then each successive thread will be delayed by 4 seconds



    默认情况下,增加是 1 .如果您正在为线程组和循环 Controller 寻找相同的行为,您需要将其设置为 0 .

    展望 future ,像 JMeter 一样快地发送请求并不是现实生活中的负载场景。真正的用户不会敲打这个或那个端点,他们需要一些时间来“思考”,然后再做下一步行动。这个“思考时间”可以使用即 Constant Timer 来模拟.然而,设置所需负载的更智能方法是使用 Constant Throughput Timer

    关于Jmeter - 线程组和循环 Controller 在性能方面的区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25651119/

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