performance - 如何为不同的 HTTP 请求分配用户数?

标签 performance http jmeter performance-testing

我的场景是允许 25 个用户点击一个 HTTP 请求,75 个用户请求另一个请求,同时使用一个或多个线程组。

   1. Default Request: www.abc.com
   2. 25 Users should hit www.abc.com/firstrequest
   3. 75 Users should hit www.abc.com/secondrequest

如何使用 Jmeter 同时允许在两个或多个不同请求之间分配用户?

最佳答案

是的,您可以使用同步计时器来实现,但仅限于一个请求,而不是多个请求。

但可以通过调整来实现所需的负载。

1. suppose you have 2 threadgroups having 1 request each. i.e. firstrequest and secondrequest 
2. create synchronizing timer as a child of testplan (by this it will be applicable to both threadgroups)
3. put no. of threads to group by as 100 (as you want 25 users to hit firstrequest and 75 users to hit secondrequest simulataneously, which means 100 concurrent users)
4. assign 25 thread count to first threadgroup
5. assign 75 thread count to first threadgroup 
6. Allow running threadgroups in parallel by not checking run threadgroups consecutively checkbox in testplan

通过这种方式,您可以生成 100 个并发用户来测试 2 个请求。 如果您不希望 2 个请求同时命中,那么您可以为每个线程组添加同步计时器并运行测试。

enter image description here

关于performance - 如何为不同的 HTTP 请求分配用户数?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26923364/

相关文章:

bash - 如何使用 tcpdump 捕获所有 HTTP 数据包

html - 为什么在没有数据传输时 EventSource 连接每 30-60 秒关闭一次,而 WebSocket 的连接保持打开状态?

java - 如何从jmeter调用java类?

ssl - 在 Jmeter 中将 --no-check-certificate 添加到 wget

c++ - 比 SQLite 还轻

android - 在gui之后在Android中加载代码

php - 如何在没有真实 URL 的情况下用 PHP 返回文件?

linux - 我的自定义 JMeter 监听器无法在 Linux 中工作

performance - Socket.io 扩展 - 减少消息数量或消息大小

c# - 此 WPF 代码能否受益于 Parallel.For 以及如何受益?