0
votes

I am working on stress test, but my first sampler floods server with tons of requests with very little amount of time, so I want to make a delay between each thread using request.

Test structure:

  • Thread1 - Sampler1 (for example: access login form)
  • Delay (custom seconds)
  • Thread2 - Sampler1 (for example: access login form)
  • Delay (custom seconds)
  • ThreadN - Sampler1 (for example: access login form)
  • Delay (custom seconds)
  • Thread1 - Sampler2
  • Delay (custom seconds)
  • Thread2 - Sampler2
  • Delay (custom seconds)
  • <...>
  • Synchronizing Timer
  • All threads realeased with final sampler (this part works)

I tried to put timers as samplers parents or childs. Probably I am missing something, because non of the timers are working for me.

I've found similar problem solutions, but non of the worked for me: JMeter - sharing a delay between requests across multiple ThreadGroups Delays for each thread in Ultimate Thread Group

4
what is the value of Rampup parameter in your Threadgroup?Nachiket Kate
You were correct. Increasing rump-up period solved the problem. Thanks. (But still I want timers to work)rweris
Timers will work for samplers and not for threads. Timers will allow delay in 2 successive samplers. But if you have Threadgroup with single request and 10 users. Timers will not help in delaying thread creation and execution. Rampup is useful in that. But if you have a threadgroup with 2 requests with 5 threads, for each thread a delay will be introduced in sampler/request execution by timers. Both of them have different functionalities. If you are not clear still I'll explain it in answer.Nachiket Kate
Your answer is very useful. I already find out, that timers only work with different samplers. But for clearance I am going to try some of the examples given in answes (stepping thread group) and (Ultimate thread group).rweris

4 Answers

1
votes

I would suggest using the stepping thread group via http://jmeter-plugins.org/wiki/SteppingThreadGroup/.

In the 'thread scheduling parameters' section, you'll note you're able to specify the maximum number of threads to run at peak, but you're also also to slowly instantiate threads as you need them.

Very plainly, the setup below says "When I run this test, I'm eventually going to want 100 threads, but when I first start the test, wait 15 seconds, then only start 10 threads. Then add another 10 threads every 120 seconds. Once we reach max threads, keep working for 180 seconds, then slowly peel off 5 threads every 15 seconds.

This should meet your need.

stepping thread group

1
votes

As per your Test Plan description, you can use 1 of the timers mentioned below:

  • Gaussian Random Timer enter image description here
  • Constant Timer
    enter image description here

Hope this will help..

1
votes

Constant Timer would be best option as per your mentioned requirement.

0
votes

You can use 'Ultimate Thread Group' instead of regular Thread Group. There is 'Initial Delay' in ultimate thread group which will help you to achieve your requirement.