How to do stress test with Jmeter step by step

1.5k views Asked by At

I want to stress test a website. Main aim is to find performance degrading point, in terms of number concurrent users and number of hits/sec (RPS).

I have used ultimate thread group and set the number users to 200 with ramp up of 200 seconds. I have added the throughput shaping timer to ultimate thread group and set the number of request per second to 8. (If I have only one sampler hits per second is well controlled and it was 8 hits/sec. If I have more than one sampler hits were not controlled and they even reached 20, 25,40 etc.. I ended up using constant throughput timer)

Let's go back to stress testing. to find the performance degrading point, in terms of number of concurrent users and hits per second, how should I simulate the load. Eg: my website's expected degradation point is 300 users at 12 requests per second, at avg response time of the site is 800ms. But it could support more users may be 500 users and may be 15 RPS. What if I want to add some delay between each sample, where should I be adding timers? to the thread group or to the samplers?

Thanks.

1

There are 1 answers

3
Dmitri T On BEST ANSWER

Timers have their scope. From the Timers documentation:

Note that timers are processed before each sampler in the scope in which they are found; if there are several timers in the same scope, all the timers will be processed before each sampler. Timers are only processed in conjunction with a sampler. A timer which is not in the same scope as a sampler will not be processed at all. To apply a timer to a single sampler, add the timer as a child element of the sampler. The timer will be applied before the sampler is executed. To apply a timer after a sampler, either add it to the next sampler, or add it as the child of a Test Action Sampler.

So:

  • if you want to delay a single request - put timer of your choice as a child of that request.
  • if you're aiming to delay all requests - put the timer at the same level as requests go
  • if you want to delay certain part of requests - move them under i.e. a Simple Controller

The similar situation is highlighted in How to Use JMeter Assertions in 3 Easy Steps guide:

Assertions Scope

The only difference is that timers are being processed BEFORE sampler and assertions are executed AFTER.