NBomber "Pacing" (Hitting an Exact Transactions per Hour) #870
Replies: 1 comment 1 reply
-
|
Here is the approach I am using
Listing 01: A Main Test Class to Launch Multiple Scenarios in Parallel Notice in the above that I am taking the number I got from Application Dynamics, the target transactions per hour, and passing it to a method which creates each load test for me. This main class, just registers the scenarios. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
[ 1/22/206: I am refactoring this discussion post to a more definitive answer instead of a question. At least an answer that's working for me.]
Goal: I want to mirror a Production load exactly (and do this by reading numbers from a Production monitoring tool such as AppDynamics.). I want to be able to plug in throughput targets and then hit those goals exactly in the load test.
JMeter has this feature, implemented by means of "timers." Like "Constant throughput timer":
LoadRunner has this feature implemented by means of setting users to a fixed (or random) iteration rate.
Visual Studio has this feature, implemented by means of its "Test Mix Model" and the "Test Mix Based on User Pace."
The goal of this feature is to guarantee hitting a particular number of transactions per hour.
Often, an organization will have a Production monitoring tool such as Adobe Analytics (formerly Omniture), or they can get peak hour transaction data from a database. With the above type of "pacing" feature, we can program the Production load right into the load test before we even run the test.
I am including a screenshot from Visual Studio of it's "Test Mix Based on User Pace", although . I think the above description about a "fixed interval between the beginnings of each iteration" is the clearest description. That is how LoadRunner does it. I think that Visual Studio does the same thing, but it just calculates the Task.Delay() for you. You put in the number of iterations per hour you want 1 user to do for that "step." Then, we can increase the number of users or threads, but the "mix" of requests remains at the same ratio (as you ramp up the test.)
The benefit of this feature is that you can look like a genius when doing Production testing: you can hit the Production peak hour exactly and not exceed it. (Exceeding the peak hour always causes a bunch of people to say that "you did not find a load bug," because "you hit the system too hard." )
With the correct pacing time you mirror the Production peak load exactly. Then, if the system falls over, the bug is in the application under test and not in the load test.
1/22/2026: In the next comment below I will post an example to achieve this goal.
Appendix: Further Notes on this Feature
See also:
The way pacing essentially works is that it marks the start time of each request (or "step," or group of requests.) It is setting a fixed interval between the beginnings of each iteration.
Beginnings is the key idea. The "calculated pacing" feature in the above tools is not affected by abnormally long response times. For the most part, it's OK if the requests are abnormally slow, because the idea here is not a fixed pacing AFTER a request ends, the pacing is measured from when the request begins. The next request will start at the same fixed pacing interval regardless of how long the request took. E.g.: Task.Delay((fixedPacingInterval- elapsedMs));
This procedure allows us to hit the exact number of the requests or transactions per hour as seen in the Production monitoring tool (the Production peak hour.) It allows us to do that without a lot of experimental load testing.
Beta Was this translation helpful? Give feedback.
All reactions