Calculating vUsers for a Scenario Using “Test Mix Based on User Pace”
Load Test vUser Models in Visual Studio
Using think time for pacing
- Test mix based on sequential test order
- Test mix based on number of tests started
- Test mix percentage on the number of vUsers starting tests
These load test mix models will run tests as fast as possible given a set number of virtual users. The only way to control throughput is by adding think time or changing the number of virtual users. Even with those controls, a change in response times can largely affect your throughput. These pacing models should only be used for stress testing.
- Test mix based on user pace
Allowing the load test to control the pacing based on the number of tests per hour per vUser is your best bet for baseline testing and load testing.
There are a few challenges with this load model. One of which is that you must make sure that you have a low enough number of tests per user per hour to achieve your goal. An example of having too high of a goal throughput would be setting 3600 tests per hour per user but the test’s average test time is 3 seconds. It’s impossible for 1 user to run the test 3600 times an hour the maximum number of tests that one user could run is 1200 per hour. To achieve your goal maybe you would set the number of vUsers to 6 and tests per hour per user to 600 which would produce the target throughput of 3600 tests per hour.
The second challenge is dealing with multiple tests in a single scenario which share the same number of vUsers. We can create a spreadsheet to help deal with this issue, but first you should do a low load test shakeout\smoke to get a starting point for response times. You will need the below information as a starting point.
Next, we will create another column labeled “Total Time” and the calculation will be “Target Throughput” * “Average Test Time”. This will give you the total time needed in seconds for the test to run.
Then sum up the “Total Time” Column and divide by 3600 seconds to get the minimum number of vUsers needed. I have rounded up the number in this sheet using the Celling function.
Create another input field where you can manual set the number of vUsers, and set it to a number higher than the minimum number.
Then add a column “Tests per User per Hour” and set the formula to be “Target Throughput” / “Number of vUsers”.
Finally, if you want to create some validation, you can use conditional formatting to let you know the risk of running the scenario as defined. Create a column named “Single vUser Time” and set the formula to be “Tests per User per Hour” * “Average Test Time”. Sum up this new column and the result should be less than 3600. Ideally it should be much less than 3600 in case response times are higher under load. Use conditional formatting on the cell where the sum exists, like the below screenshot.
Your new vUser pacing calculator will look something like this when finished.