Test iteration setting in loadtest using vs 2010 - visual-studio-2010

I wanted to test my application for 250 concurrent users, I have some doubts about the load test setting.
What should be the correct setting to achieve the above...
I have set the Max user count as 250 and test iteration in run setting as 1, So will it send 250 virtual request ???
or
I have to set the Max user count as 250 and test iteration in run setting as 250

Here are some explanations about load test settings:
In the Constant Load Pattern you set how the load test will create your virtual users.
If you Set Pattern = Constant then visual studio will create 250 virtual users without meaning that you need them. So if you have 250 users and only 10 Tests Iterations, only 10 users will send a request
If you set Pattern = Step you set an initial number of virtual users and they are increased at each test iteration by the Step User Count. Again, you may create more users form those you will actually need.
In the Run Settings there are 2 basic settings you should focus:
The Test Iterations, which describes the total number of requests (tests) that will be executed from all the virtual users. So, if you set this value 500 and you have a Constant Pattern of 250 virtual users, then each user will send 2 requests. Perhaps some will send 3 and some others 1, but the total tests (requests) will be 500.
The Use Test Iterations setting which describes whether the test should be executed according to the Test Iterations settings (previous scenario) or according to the Run Duration setting. If you set this property to false, then all virtual users will try to execute as many requests/test as they can in the Test Duration time.
So, answering to your questions:
I have set the Max user count as 250 and test iteration in run setting as 1, So will it send 250 virtual request ???
No, it will send only one request. Set the Test Iterations = 250 if you want 250 total tests .
I have to set the Max user count as 250 and test iteration in run setting as 250
This will send 250 total tests but it doesn't mean that they will be concurrent. The 250 virtual user will not created at once, it depends of their initial number. So, if you want 250 concurrent tests you must set the Pattern = Constant.

Related

Do Gatling reports req/s include pauses and pace?

I'm running load tests in gatling, and noticed when I ramp 250 users over 10 seconds, the report gives me an average of 31 req/s:
val combinedScenario = scenario("Combined")
.feed(UuidFeeder.feeder)
.exec(_.set("token", token))
.exec(saveData)
.exec(processDocumentRequest)
)
val scn = List(OAuthRequest.inject(atOnceUsers(1)),
combinedScenario.inject(nothingFor(5 seconds),
rampUsers(250) over (10 seconds)));
setUp(scn).protocols(httpConf).maxDuration(60 minutes)
However, when I surround the scenario in a forever loop and put a 60 second pace in between each set of requests, the report then says I average about 8 req/s:
val combinedScenario = scenario("Combined")
.feed(UuidFeeder.feeder)
.exec(_.set("token", token))
.forever(
pace(60 seconds)
.exec(saveData)
.exec(processDocumentRequest)
)
Is this simply because the report factors in the 50 seconds in between iterations where 0 requests are being sent? Can I assume that it's still sending around 31 req/s for the short bursts of requests being sent each minute?
Yes - the reports just show what the actual throughout during the scenario was, not some hypothetical maximum. The number you get could be constrained by your scenario or by the application under test. You would need to run some experiments to confirm.
With the pace in the scenario, you should also be able to increase the number of concurrent users, based on your initial testing

Execute httpSample conditionally JMeter

I need to test a REST method for saving an object. In order to have the ability to save it I need to request an authToken that is updating each 100 seconds.
Right now I have a thread containing both requests , and the login request is executed each time the saving does. How can I make the login execute once at the start of the thread and then each 100 seconds ?
P.S. I've tried separating it in 3 threads , one for the initial login , the other with a loop and a 100 seconds timer and finally the one with the actual test. It does work ,but it seems like a bad solution.
How about:
|-Login
|-Loop n times
|-Save
n being number of times that will be just about less than 100ms?
or
|-If login valid?
| |-NO: Login
|
|-Save
option 3:
ThreadGoup1
|- Login
|- Beanshell update shared token
|- Constant throughput timer
ThreadGroup2
|- Beanshell fetch shared token
|- Save
A constant throughput timer allows you to run at a set throughput. Once every 100 seconds is 0.6 samples per minute, I'm not certain you can do fractions, but even 1 sample a minute should work for you.

Jmeter: Threads multiplied by loop count does not match number of samples

I am running some tests in Jmeter with the following values -
Number of Threads = 50
Number of Loop count = 133
I would expect the number of samples (column Count in the Summary report) to be 50*133=6650 but I see this as only 3220.
I tried this test with:
Number of Threads = 50
Number of Loop count = 100 and this time also I got the number of samples (Count) as 3221
I tried with:
Number of Threads = 30
Number of Loop count = 133 and this time also I got the number of samples (Count) as 3220
For some reason, Jmeter is limiting the max number of samples to a number around 3220. Why is this happening?
Regards
Ramesh
JMeter doesn't have limitation on number of samples, if it is, it would be something like 2 billion.
Try the following:
Re-run your test in non-GUI mode
Open JMeter GUI. Don't open any .jmx file
Add Summary Report Listener
Click Browse button and open .jtl file which you specified by -l parameter in step 1
Check if real samples count matches your calculation.
It should be equal. If it isn't make sure that i.e. you are not using Test Action Sampler which stops the test on certain condition or CSV Data Set Config with Stop thread on EOF set to true or whatever.
If the problem still persists and none of above recommendations help update the issue with your jmeter.log file

How to evenly increase number of users in 3 Thread Groups saving proportion of requests between them?

I have 3 Thread Groups in my test plan.
These Thread Groups must be with fixed request weights (for example 1st-50%, 2nd-40%, 3rd-10%).
If I need to emulate constant number of users, the solution in this post which was given by #PMD UBIK-INGENIERIE works good if I set Loop Count as number (1, 10, 100 ect.). But the problem is when I set the check-box "forever" for Loop Counts, the proportion between groups is broken.
Now I need to increase the amount of users, saving proportion of requests between my 3 groups, to perform the capasity assessment.
All 3 groups must send requests evenly, in this constant proportion 50-40-10.
If I use Stepping Thread Group, I can evenly increase number of users in each of them, but I can't set the proportion of request for them.
Could you please tell me any idea, how to do this?
UPD1.
My screenshots with settings:
and
What is wrong?
UPD2. The last variant (I have put numbers manually for each group) is (Thread Group1 - 50%):
The idea is the same as in PMD UBIK-INGENIERI's answer.
Set USERS variable in User Defined Variables or test plan variables (or you can pass it through command line).
Also set variables:
PERCENT1 to 0.5
PERCENT2 to 0.4
PERCENT3 to 0.1
Add 3 stepping thread groups with:
"This group will start" set to
${__BeanShell(Math.round(${PERCENT1}*${USERS})}
${__BeanShell(Math.round(${PERCENT2}*${USERS})}
${__BeanShell(Math.round(${PERCENT3}*${USERS})}
"Then start" set to:
${__BeanShell(Math.round(${PERCENT1}*${USERS}/10)}
${__BeanShell(Math.round(${PERCENT2}*${USERS}/10)}
${__BeanShell(Math.round(${PERCENT3}*${USERS}/10)}
It will work if value of USERS variable can be divided by 100

JMeter - Firing different requests in every iteration

I am currently using JMeter to simulate 5 users firing requests every 40 seconds. I have created 100 different requests but after every 40 seconds, each user is firing all 100 requests. I want to make it in such a way that after every 40 seconds, each user only fires 1 request and that request has to be different from the previous request. I would like to know what kind of controller to use (or anything else) to achieve this scenario.
Thanks
Try to use Random Controller.
The simplest way to implement your scenario:
Thread Group
Number of Threads = 5
Loop Count = N
. . .
Random Controller
HTTP Request 001
HTTP Request 002
HTTP Request 003
. . .
. . .
HTTP Request 100
Test Action
Target = Current Thread
Action = Pause
Duration = 40000
. . .
This will iterate 5 threads N times.
Random Controller will RANDOMLY pick up on each step http request from "requests pool" - all the samplers added as children to Random Controller.
Test Action will pause thread for 40 secs.
Updated:
working illustration for above scheme:
Thread Group
Number of Threads = 5
Ramp-Up Period = 0
Loop Count = 10
Constant Timer
Thread Delay (in ms) = 40000
You can download working example for described scheme from here: rc-plan.jmx.
This one works how you want (at least for me, Jmeter 2.5.1): it picks randomly ONE request from requests pool (in example - 10 requests) for EACH user (here - 5 users) on EACH step (here - 10 loops) and pauses each thread for 40 secs (Constant Timer).
You can also look into this mailing archive: Is their a way to randomize URL selection?.
Situation similar to your one seems to be described here.
...As per official documentation "Interactions between multiple controllers can yield complex behavior. This is particularly true of the Random Controller."
Another option for you may be to create a CSV file with parameters for your requests ahead of time and use CSV Data Set Config to parameterize a single http request.
That obviously depends on how different your http requests are, but if it fits your requirements there are some potential bonuses with maintaining 1 http request in your test plan vs. 100.
The other details would be the same as #Alies Belik laid out -- one thread group configured for your required number of threads and loops, with a constant timer at the end for your 40 second pause.

Resources