Performance Testing and Engineering are quantitative approaches in which numbers and formulae play a vital role. You can not think about Performance Testing without understanding the basic mathematics behind the testing technique. This article has some basic formulae that will help you to understand the logic and relationship between different performance testing terms. So, let’s start:
Little’s Law:
For Web Applications:
U = IR * (IRT + TTT + P)
where:
- U = No. of Users (User Load)
- IR = Iteration Rate (Iterations per second)
- IRT = Iteration Time i.e. Time to complete one iteration
- TTT = Total Think Time
- P = Pacing
For Web Services / API:
U = T * (IRT + TTT)
where:
- U = No. of Users (User Load)
- T = Throughput (Requests/calls per second)
- IRT = Iteration Time i.e. Time to complete one iteration
- TTT = Total Think Time
Concurrent User (per hour)
CU = (NSavg * SDavg) / 3600
where:
- CU = Concurrent Users
- NSavg = Average number of sessions per hour
- SDavg = Average Session Duration (in seconds)
Response Time
RT = ND + SPT
where:
- RT= Response Time
- ND = Network Delay
- SPT = Server Processing Time
Network Delay
ND = NPD + QD + TD + PD
where:
- ND = Network Delay
- NPD = Nodal Processing Delay
- QD = Queuing Delay
- TD = Transmission Delay
- PD = Propagation Delay
Service Time
ST = BT / N
where:
- ST = Service Time
- BT = Busy Time
- N = No. of transactions/requests processed during the busy time
Queue Length
QL = X * QT
where:
- QL = Queue Length
- X = Throughput; Request arrival rate
- QT = Time spent waiting in a queue for access to computing resources
Throughput (Rate)
X = N / T
where:
- X = Throughput (in seconds)
- N = No. of Request or Calls
- T = Total Time (in seconds)
Utilization
Ut = BT / T
where:
- Ut = Utilization
- BT = Busy Time
- T = Total Time (in seconds)
Average Utilization
Uavg = (X * ST) / M
where:
- Uavg = Average Utilization
- X = Throughput
- ST = Service Time
- M = Average Number of Servers
Important Calculators
- Virtual User Calculator
- Pacing Calculator
- Think Time Calculator
- TPS Calculator
- Test Data Calculator
- Iteration Calculator
- Load Generator Calculator
- Linear Extrapolation Calculator
- JMeter CPS Calculator
If you are aware of more Performance Testing Formulae then write in the comment section.
You may be interested:
- What does come under ‘Response Time’?
- Extension of Little’s Law for correct workload modelling in Performance Testing