开发者

Jmeter - simulating more complex load scenarios?

Been experi开发者_JAVA百科menting with Jmeter, and I'd like to know the best way to accomplish:

20 users logging onto an application, over 20 minutes, and performing some actions for another 20 minutes, before logging off over a period of 20 minutes. I.e. have 200 users logging on, and then once ALL of them are logged on, begin 20 minute timer. Once 20 minutes are up, start to log the ones who logged on earliest off.

I realise this MAY or MAY NOT BE a realistic testing scenario, but i'd like to see if it's possible.

At the moment I have a test plan whereby a user logs on, performs some actions, and then logs off. I can't see how I can ramp up and ramp down.


There's an option in Test Plan "Run thread groups consecutively". Set it to checked.

Then add 3 thread groups to your test plan. I'd suggest using Thread Group for first (20 threads, loop count 1, ramp up time 1), Ultimate Thread Group (20 threads starting immediately and holding load for 20min) for second and Thread Group again for third (20 threads, loop count 1, ramp up time 1).

Place appropriate samplers inside each TG - first just logs in, second does actions, third logs off.

That's it. If you have any troubles - let me know.


You'll need several thread groups in JMeter starting off and running at different intervals, in that way you could ensure that the users who start first will end first.

Also see a related question on this.


You can have no of users=20, ramp up time=1200 sec (1 per min), difference of time between test start and test end time=20 min to achieve that.


I think I had a similar problem in the past

Here Want I've did:

First set your thread group to have 20 thread with a rampup period of 60 seconds

After the login put a "test action" (in the sampler menu) target = current thread, with the action pause and 20 minutes (1 200 000 ms) or more if you want to be safe.

After this test action, put all your navigating request.

Once your navigation is done, put another "test action" with the same setting has the previous one

(target = current thread, with the action pause and 20 minutes (1 200 000 ms)) put the logouf request after the sampler.

This should cover you case.

Take note that the sampler just pause your thread so the first thread that start should be the first thread that end.

If you want to scale it to 200 you just need to change your thread group rampup period to 6 or 5 seconds.

hope it's help.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜