Session pacing is an interval between two sessions/Iterations executed by a virtual user. This is used to simulate a Load Model for a real-life test where users can access an application after some interval.
Session pacing is used to generate controlled load. Session pacing, along with think time, also helps to better simulate the user's experience and provides a more realistic load test. It is applicable only in Fixed Concurrent Users(FCU) test.
SESSION PACING OPTIONS
As soon as the previous session ends A new session begins as soon as the previous session ends.
After the previous session ends
A new session starts after the previous session ends followed by the following delays applied
With fixed delay of specified seconds.
With random (Internet type distribution) average delay: Session Pacing is an Internet distribution random value with median as specified which is roughly 1/4th of the mean.
With random (Uniform distribution) delay: Session Pacing is a uniform random value between from and to value specified.
Once every interval (Provided that the previous session ends by that time else the next session starts, as soon as the previous session ends)
At a fixed Interval of specified seconds.
At random (Internet type distribution) average intervals : Session Pacing is an Internet distribution random value with median as specified which is roughly 1/4th of the mean. (recommended).
At random (Uniform distribution) average intervals form minimum to maximum seconds.
This is the recommended session pacing setting and is recommended to be 1.5X to 2X of the average session duration.
NOTES
If a session is completed within the specified interval, then the next session will have to wait for the remaining time of the specified interval. For example, If the interval is 200 seconds and a session completes in 120 seconds, the next session will start after 80 seconds.
If a session exceeds the specified interval, the next session will be started as soon as the previous session ends. For example, If the interval is 200 seconds and a session completes in 220 seconds, the next session will start soon after the previous session. But in such cases, a negative credit of pacing delay is maintained and that is adjusted against future positive credit of pacing delay so as to provide a constant average session pacing.
Introduce delay before first Session
When enabled, a delay is applied before the start of the first session of each VUser. This delay is calculated by randomizing mean pacing time specified using the above selected option.
Simulate a new user on each session
By default, a new session is always started by a new VUser and a new VUser always starts with a clean slate. i.e. no user parameters (such as file parameters), no cookies, no browser cache and no connections.
When the same user option is enabled, the same virtual user continues the new session with all connections which are already established, cache maintained and clean slate or User parameter and user cookies associated with the user in the previous session as per the following settings:
Clear user parameters(For example dataset using file, Search parameter etc.):
Always : It will clear user parameters after every session
Never : It will not clear user parameters
on session failure : It will clear user parameter only when a session is failed.
Clear user cookies: Always, Never or on session failure : same as above.
Example
Let's say for an example, we would like to generate 100 TPS load test from a script which has 5 transaction. Where each transaction has a response time of 5 seconds and think time of 2 seconds and we want to run the load test with 700 VUsers. Let's calculate session pacing using the below formula
Session Pacing =
(No of Users * Transactions in a session/ Transactions per second ) - (End to end response time of a session including Think time)
Requirements
No of Users= 700
Transactions in a session = 5
TPS =100
End to end response time of a session including Think time = 33 sec
Session Pacing = (700*5/100)-(33) = 2 Seconds
Iteration 1
Index - 5 second
Think time = 2 sec
Login - 5 second
Think time = 2 sec
Reservation - 5 second
Think time = 2 sec
Find Flight - 5 second
Think time = 2 sec
Welcome - 5 second
Pacing = 2 sec
Iteration 2
Index - 5 second
Think time = 2 sec
Login - 5 second
Think time = 2 sec
Reservation - 5 second
Think time = 2 sec
Find Flight - 5 second
Think time = 2 sec
Welcome - 5 second
Runtime Changeable Yes
NOTES
It is applicable only in Fixed Concurrent Users (FCU) Test.
Applied session pacing can be seen in Page based stats and Virtual user trace.
Once every interval is the recommended session pacing setting and is recommended to be 1.5X to 2X of the average session duration.