Enabling a Session Limit
- On the Test Scenario page, enable Limit Sessions.
- Enter the maximum number of sessions in the Limit field.
How Session Limit Works
Limit Is Reached Before Test Ends
If the session limit is reached before the end of the test duration time, the test will be stopped regardless of the number of completed sessions. For example, if the test duration time is set to 40 minutes, and 10,000 sessions are completed at the 20th minute of the test run, the test will be stopped at the 20th minute.
End of Test Is Reached but the Sessions Limit Is Not
If the test duration time is over, but the number of sessions you specified in the Limit field is not reached, the system stops the test.
Session Limit Does Not Guarantee an Exact Session Count
Limit Sessions caps the number of sessions a test can run — it does not guarantee that number will be reached. The system prioritizes concurrency over session count. If some virtual users fail to start, start late, or don’t complete a session before the test ends, the actual completed session count can be lower than the Limit value.
This is more likely when:
- Session duration is long relative to test duration.
- The test uses Unique per Session variables, since each session requires an unused value from the uploaded data, and no substitute value is available if one runs out.
- The test uses a ramp-up or ramp-down load curve, which makes session timing less predictable than a flat load.
Getting a Predictable Session Count
If you need a specific number of completed sessions (for example, to compare statistics across repeated runs), choose one of the below approaches.
General Recommendation
Use a flat Start With + Hold load plan rather than ramp-up/ramp-down when an exact session count matters.
Option 1 — Use Session Limit with extended test duration
- Enable Limit Sessions and set your target number of sessions.
- Set Test Duration to roughly 2–2.5 x the expected session duration, giving the system time to recover if some sessions fail to start on the first attempt.
Trade-off: higher cost, and the configured concurrency still isn’t guaranteed.
Option 2 — Control session count via test duration, not Session Limit
- Disable Limit Sessions.
- Set Start With to the number of users you need, with an appropriate Hold duration.
- Set Test Duration slightly longer than the time needed to complete the desired sessions per user.
Trade-off:Â most likely you will see more sessions when the test is complete, but some sessions will be incomplete.
Session Limit in Parametrised Tests
Note that when a load test uses context parameters and the Unique per Session mode is selected, the Limit Sessions option will be automatically activated. In this case, the limit value will be read-only and set to the number of the value rows in the uploaded CSV file or to the Value Rows Range if specified. If you need to change the limit in the Unique per Session mode, adjust the Value Rows Range or the number of value rows in your data CSV file.
