本文介绍了Jmeter 单线程组中的多个并发用户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有 1 个线程组,并且我用 single HttpSampler 定义了 100 个线程1 Iteration.基本上我正在测试一个 GET API.

I have 1 thread group and I have defined 100 threads and 1 Iteration with a single HttpSampler. Basically I am testing a single GET API.

现在,Jmeter 应该启动 100 个线程,然后它们应该向我的具有 API 的服务器发出请求.服务器可以同时响应 100 个请求.所以,基本上在任何时间点我都应该有 100 个并发.

Now, Jmeter should start 100 threads and then they should fire request to my server which have the API. The server can respond to 100 requests concurrently. So, basically at any point in time I should have 100 concurrency.

但是当我通过 Blazemeter 检查时,情况并非如此.我得到的最大用户数为 37,总用户数为 100,这意味着测试期间的最大并发数为 37.

But that is not what is happening when I checked through Blazemeter. I get a max users of 37 and total users as 100 which means max concurrency during the test was 37.

这只有在 Jmeter 没有并行执行线程时才有可能.那么我错在哪里呢?

This can be possible only if Jmeter did not executed the threads parallel. So where am I wrong ?

我希望所有线程在所有线程都创建后并行执行并立即触发请求,以便 1 次迭代的最大并发数为 100.

I want all threads to execute parallel after they all are created and fire requests at once so that maximum concurrency is 100 for 1 iteration.

推荐答案

如果您需要更多控制和准确性,请使用 终极线程组 JMeter 插件(代替常规线程组)

If you need more control and accuracy use Ultimate Thread Group JMeter plugin (instead of regular Thread Group)

将开始线程数设置为 100,初始延迟为 0,启动时间为 0,保持时间为正,您的线程将容纳 100 个最大用户

Set Start Thread Count as 100, with 0 initial delay and 0 Startup Time, with positive Hold time, your thread will hold 100 max users

一般示例:

如果您的计算机无法处理生成负载,您可能需要分布式测试设置

If your computer can't handle generating load, you may need distributed testing setup

这篇关于Jmeter 单线程组中的多个并发用户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-20 06:05
查看更多