Thursday, July 21, 2016

Pacing in Loadrunner


Pacing

Pacing is one of the options in General tab under Run time settings.  Pacing is waiting time between the iterations. Pacing is used to simulate the real user actions. The main purpose of pacing is to avoid the burden on the server. If there is no pacing between the iterations, server will receive many hits at the same time.  We have three options in pacing.

  • As soon as the previous iteration ends
  • After the previous iteration ends with a fixed or random delay of
  • At fixed or random intervals, every….[to…]seconds


As soon as the previous iteration ends: if we enable this option, there will be no waiting time between the iterations. The new iteration will start as soon as the previous iteration ends.
Ex: Time taken to complete one iteration is 4 sec.  If pacing is set to a value, It will not be considered. Next iteration will start after 4 sec.
After previous iteration ends with a fixed /random delay of: If we enable this option,  the next iteration will start after the specified (fixed/random) interval of time.
EX1:  Time taken to complete first iteration is 4 sec.   Pacing is set to a fixed value of 3sec. The second iteration starts after 7 sec (time taken to complete first iteration +fixed pacing time).
EX2: Time taken to complete first iteration is 4 sec.   Pacing is set to a random value in range of 60-90 sec. The second iteration starts after 64-94 sec (time taken to complete first iteration +random pacing time).
At fixed or random intervals, every….[to…] seconds: If enable this option,  the second iteration  will start when specified(fixed/random)pacing time ends. Pacing will start at the same time as first iteration starts.
EX1:  Time taken to complete first iteration is 4 sec.   Pacing is set to a fixed value of 10sec. The second iteration will start after 10sec (fixed pacing time).
EX2: Time taken to complete first iteration is 4 sec.   Pacing is set to a random value in range of 60-90 sec. The second iteration will start after 60-90 sec (random pacing time).
EX3: Time taken to complete first iteration is 4 sec.   Pacing is set to a fixed value of 1sec. Pacing has to be more than Time taken to complete first iteration. But Pacing is set to 1 sec which is less than Time taken to complete first iteration i.e. 4 sec. Vugen will throw an warning message “Pacing could not be achieved”.
Note:
We will get the pacing times from production logs.
Question
If we have license 500 logins per one hour with gap of one second and we want to run 1000 users per one hour, how can you handle that situation?
Solution is reducing the pacing.
Actually concurrent user’s means continuously hitting to server without any gap of time, but we give time one minute for even concurrent also.
Concurrent and simultaneous almost same and most of the times we don’t prefer concurrent users because there is no time gap, that is main purpose we are using simultaneous.
If we use concurrent user. The request will be send continuously without pacing. So it will burden on the server and up to 200 users only support more than 200 like it will put queue mechanism
Example

Vusers Iteration time
1 1 1
30 30 30 min
30 30 120


So here 1 min for execution of transaction and remaining time for 3 minutes is pacing
We will get pacing times from client based on the production log. If we don’t have production logs than we will takes values based on the benchmark else based on client business.

No comments:

Post a Comment