Important SPE Fundamentals Formulae
As Performance Engineers we have to deal with numbers all the time. Whether you are validating results of a performance test, performing back of the envelope capacity plans or determining the overall service time for multi-tier application you need to understand the various Performance Engineering quantities and understand how to apply the various performance formulae. This page lists down all the relevant Performance Engineering formulae. This list will grow over time based on input from yourself and other readers.
Over a period of time I will be providing additional material on each of the topics and equations below aimed at simplifying understanding of each of the concepts. Please feel free to send in your input, feedback and comments.
Lets start by defining all the basic Performance Engineering related quantities and then look at some of the most useful formulae –
- Basic Performance Quantities :
- Response Time or Rt - Elapsed time or the total time between submission of the request and receipt of the final response from the server.
- Time to First Byte or Buffer - Time To First Buffer is the Elapsed Time between submission of the request and receipt of the first response from the server.
- Think Time or Zt - Elapsed time spent by the user between two successive actions (i.e. submit form, upload data, etc.)
- Service Time or St - Time spent by the server processing a given request. Generally tends to remain constant for a given transaction type.
- Service Demand or Dt - Service Demand is defined as the total Service Time requested by a given Entity (Request) from a particular System Component.
- Queuing Time or Qt - Time spent waiting in a queue for access to computing resources.
- Busy Time or Bt - The time duration for which the server resource i.e. cpu, mem, etc. was busy doing work.
- Wait Time or Wt [Same as Queuing Time] - Same as Queuing Time.
- Number of Completions or C - Transactional Completions is simply defined as the number of successful transactions that were processed within a given time period. Completions are denoted by C.
- Number of Arrivals or A - Transactional Arrivals are simply defined as the number of requests arriving at the server for processing. Transactional Arrivals are denoted by A.
- Queue Length or Q - The total number of requests waiting in the queue.
- Throughput or X - The total completions per unit time e.g. Transactions/Sec.
- Utilization or U - Ratio of Busy Time to Total Time of Observation.
- Average Number of Servers (CPUs, Cores, Threads) or M - M is used to designate the Average number of CPUs, Cores or Threads on a given Server.
- Number of Users within the System or User Concurrency N - The number of active or concurrent users performing a given action within a system is denoted by N.
- Littles Law - Little’s Law states that the long-term average number of customers in a stable system N is equal to the long-term average effective arrival rate, Lambda (L), multiplied by the average time a customer spends in the system, Rt.
- Response Time - R(t) :
- Rt = Wt + St ……………………. [ Wt = Wait Time, St = Service Time ] also written as
- Rt = Qt + St ……………………. [ Wt = Wait Time, Qt = Queuing Time ]
- Throughput – X :
- X = C / T ………………………………. [ C = Completions, T = Total Observed Time Interval ]
- Xmax <= 1 / Stavg ………………… [ Xmax= Maximum Value of Throughput possible, Stavg = Average Value of Service Time ]
- Utilization – U :
- U = Bt / T …………………………. [ Bt = Busy Time, T = Total Observed Time Interval ]
- U = X * St …………………………. [ X = Throughput, St = Service Time ]
- Uavg = [ X * St ] / M …………….. [ Uavg = Average Utilization, X = Throughput, St = Service Time, M = Average Number of Servers ]
- Queue Length – Q :
- Q = X * Qt ……………………….. [ X = Throughput, Qt = Queuing Time ]
- Service Time – S(t) :
- S = B / C ……………………………… [ Bt = Busy Time, C = Completions ]
- Little’s Law :
- N = Rt * X ……………………….. [ N = Number of Users in the System, Rt = Response Time, X = Throughput ]
- N = [Rt + Zt] * X ……………….. [ N = Number of Users in the System, Rt = Response Time, Zt = Think Time, X = Throughput ]
- Response Time Model :
- Uavg = [ X * St ] / M …………….. [ Uavg = Average Utilization, X = Throughput, St = Service Time, M = Number of Servers ]
- Rt = St / [ 1 – UavgM ]……….. [ Rcpu or Rt= CPU Response Time, Uavg = Average Utilization, St = Service Time, M = Number of Servers ]
- Rt = Qt + St ……………………….. [ S(t) = Service Time, Rt = Response Time, Qt = Queuing Time ]
- Qt = Rcpu – St……………………… [ Rcpu = CPU Response Time, Qt = Queuing Time, St = Service Time ]
- Q = X * Qt …………………………..[ Q = Queue Length, Qt = Queuing Time, St = Service Time ]
- Erlang C Model for a CPU Sub System:
- Xq = Xsys / Qn ……………………..[ Xq = Arrival Rate at queue, Xsys = System Arrival Rate or Total Arrival Rate, Qn = Number of Queues in the System (should be 1 for CPU systems)]
- Uavg = [ Xq * St ] / M …………….[ Xq = Arrival Rate at queue, St = Service Time, M = Number of Servers In the System, Uavg = Average Utilization across CPU’s]
- Ec = ErlangC (M, St, Xq) ………..[ Xq = Arrival Rate at queue, St = Service Time, M = Number of Servers In the System ]
- ErlangC (M, St, Xq) = { [ (M St Xq) M ] / m ! } / { (1 – M St) Sigma k=0 to (m-1) [ (M St Xq)k / k ! ] + [ (M St Xq) m ] / m ! }
- Qt = Ec St / [ M (1 – Uavg) ] ……….[ Ec = ErlangC Constant, St = Service Time, M = Number of Servers In the System, Uavg = Average Utilization across CPU’s, Qt = Queuing Time]
- Q = Xq * Qt …………………………..[ Xq = Arrival Rate at queue, Qt = Queuing Time, Q = Queue Length ]
- Rcpu = Qt + St ………………………..[ Rcpu = CPU Response Time, Qt = Queuing Time, St = Service Time ]
- Erlang C Model for a IO Sub System:
- Xq = Xsys / Qn ……………………..[ Xq = Arrival Rate at queue, Xsys = System Arrival Rate or Total Arrival Rate, Qn = Number of Queues in the System]
- Uavg = [ Xq * St ] / M …………….[ Xq = Arrival Rate at queue, St = Service Time, M = Number of Servers In the System (Should be 1 for an IO Sub System), Uavg = Average Utilization across CPU’s]
- Ec = ErlangC (M, St, Xq) ………..[ Xq = Arrival Rate at queue, St = Service Time, M = Number of Servers In the System (Should be 1 for an IO Sub System)]
- ErlangC (M, St, Xq) =Â { [ (M St Xq) M ] / m ! } / { (1 – M St) Sigma k=0 to (m-1) [ (M St Xq)k / k ! ] + [ (M St Xq) m ] / m ! }
- Qt = Ec St / [ M (1 – Uavg) ] ……….[ Ec = ErlangC Constant, St = Service Time, M = Number of Servers In the System (Should be 1 for an IO Sub System), Uavg = Average Utilization across CPU’s, Qt = Queuing Time]
- Q = Xq * Qt …………………………..[ Xq = Arrival Rate at queue, Qt = Queuing Time, Q = Queue Length ]
- Rcpu = Qt + St ………………………..[ Rcpu = CPU Response Time, Qt = Queuing Time, St = Service Time ]
We appreciate your support in building the community of Practical Performance Analysts. We are looking for the bright spark and if you think you have what it takes to build and grow this community reach out to me over email at trevor at practicalperformanceanalyst dot com. We look forward to hearing from you.
Additional Resources
- Dr. Rajesh’s papers on Performance Testing and Performance Requirements Gathering
- Microsoft : Load Testing of Web Applications
- Microsoft : Patterns & Practices – Performance Testing Guidance
- The Server Side : Performance Engineering – A Practitioners approach to Performance Testing
- Dr. Connie Smith on Performance Engineering
- Dr. Rajesh Mansharamani on Performance Engineerirng
- Wikipedia on Performance Engineering
Hope you’ve enjoyed the content in this section at Practical Performance Analyst and have learnt something new. Please help us grow the community by taking a moment and sharing this content with rest of community using your preferred Social Media Platform (links provided below). We are looking for the bright spark and if you think you have what it takes to build and grow this community reach out to me by Sending us an email.
Trevor Warren is passionate about challenging the status-quo and finding reasons to innovate. Over the past 16 years he has been delivering complex systems, has worked with very large clients across the world and constantly is looking for opportunities to bring about change. Trevor constantly strives to combine his passion for delivering outcomes with his ability to build long lasting professional relationships. You can learn more about the work he does at LinkedIn. You can download a copy of his CV at VisualCV. Visit the Github page for details of the projects he’s been hacking with.