Thursday, 16 June 2022

WorkLoad & Workload Modelling

 > Work Load

  • WorkLoad is nothing but a model based on your future forecast.
  • The distribution of load across the identified scenario.
  • Different workloads are created to study the behavior of the system.
 
> Work Load Modelling

  • WorkLoad Modelling identifies one or more workload profiles to be simulated against the tested application.
  • The workload model attempt to approximate real life usage scenario and includes different user types and characteristics.
  • Workload model depends on the parameters like transaction per sec (TPS) , pacing, think time and response time. According to queueing theory, a discipline in mathematics Little's theorem.




















👉Little's Law 👈

Little's law helps to design an accurate workload model to achieve the performance testing goal.

Average number of users in the system =Throughput*Total execution time

                                                N=TPS * (RT+TT+PT)

 N (No. of Users) = Number of active users as defined in the load test scenario.

TPS (Transaction Per Second) It is the number of transactions processed per sec; it can be used as the arrival rate (λ). Throughput can also be used as TPS.

TPH (Transaction Per Hour)It is the number of transactions processed per hour.(If you have TPH-Transaction Per Hour value, divide it by 3600 to convert in to TPS).

RT (Response Time) Average response time is the amount of time a request spent in the system.

TT (Think Time) Think time is the user pause between the transactions.

PT ( Pacing/ Session Pacing)Pacing is the time duration provided to put delay between the two iterations.


Example : 

1. Calculating no of users using Little's law:

Suppose we have an application with order place workflow. Client has given a requirement that they want to achieve 3600 order in an hour with think time of 20 seconds and pacing of 5 seconds. Assume that script take 20 seconds to execute without think time and pacing. Calculate no of virtual users to achieve the desired output.

Formula for calculation number of users :

N=TPS * (RT+TT+PT)
TPS = (TPH/3600)

TPS = 3600/3600 = 1
RT= 20
TT= 20
Pacing = 5

N = 1 * (20+20+5)
N = 1 * 45
N = 45


Total no of virtual users is 45.

2. Calculating pacing/session using Little's law:

An e-commerce website has 600 customers load during normal hours and receives average 5000 orders per hour.
  • One business functionality : Product Order
  • Test scripts contains these below transactions : 12 transaction
  1. Home Page
  2. Login
  3. Search Product
  4. Select Product
  5. Product Details
  6. Add to Cart
  7. Review Cart Item
  8. Checkout
  9. Select Delivery Address
  10. Order Summary
  11. Payment Page
  12. Logout

Formula for calculating Pacing :

N=TPS * (RT+TT+PT)
TPS = (TPH/3600)

TPS = 5000/3600 = 1.38
N=600
RT=?
TT=?
Pacing=?

=>600=1.38 * (RT +TT +Pacing)
=>600/1.38=(RT +TT +Pacing)
=>434.78 =(RT +TT +Pacing)

Execute the script for 1 iteration without TT.
The script took 24 seconds.

=>434.78 = 24 +TT + Pacing
=>434.78-24 = TT + Pacing
=> 410.78 =TT + Pacing

Assume TT as per content & user activities. (Browse the application manually and record the TT  for each transaction ** Use developer tool** )

12 transaction = 110 seconds

=> 410.78 =110+ Pacing
=> 410.78-110 = Pacing
=> 300.78 = Pacing





Pacing will be 300.78 sec.

7 comments:

  1. Superb explanation.

    ReplyDelete
  2. Simple and clear concept

    ReplyDelete
  3. Nice detailed information

    ReplyDelete
  4. Nice explanation

    ReplyDelete
  5. Your contents are so reliable as always.

    ReplyDelete
  6. Tomorrow is my interview. After reading your workload model article, I feel so confident about my interview.

    ReplyDelete
  7. Thanks for your valuable contributions. Keep it up!!!

    ReplyDelete

WorkLoad & Workload Modelling

 > Work Load WorkLoad is nothing but a model based on your future forecast. The distribution of load across the identified scenario. Diff...