Tuesday, January 31, 2012

Ensuring Accuracy in Performance Testing


Most of the time applications may face performance issues even after rigorous performance validation. This is primarily because of improper performance test environment setup and model. It is a common issue across the industry that the testing tool might not have performed correctly during the load testing. So it is always a best practice and a mandate to validate that the testing tool simulates the network traffic as expected genuinely and to ensure the test environment is also accurate. Here is an idea, how Queuing theory Laws can be applied in validating the Performance test accuracy and to ensure that the application has a smooth accessibility in production without performance issues.

Little’s Law
The long-term average number of customers in a stable system L is equal to the long-term average effective arrival rate, λ, multiplied by the average time a customer spends in the system, W and it is expressed algebraically,
LλW


Applying Little’s Law in Performance Testing
The Average number of (virtual) users N in the system (server) at any instance is equal to the product of average throughput X and average response time Z. It is expressed algebraically,

N= X * (Z + R), where R=think time
Demonstration of Little’s Law to ensure Performance Testing
From the results obtained from the performance testing tool, we can find how many actual users have been generated to test the application using Little’s Law. A sample load test done on a sample application with 10 users has obtained following test results.

Average Transactions/sec=1.7, Average transaction response time=0.5 sec, Average Think time=5sec


By Little’s Law, Number of virtual users emulated by the performance testing tool is, N=X*(Z+R) =1.7*(0.5+5)
N=9.35≈10 virtual users have been emulated during load test

If the actual virtual users used in the system is equal to the Little’s Law result, then neither the tool nor the server has undergone any problem. If the Little’s Law result is less than the actual virtual users, then it means remaining users were idle throughout the test.

* It is understood that the throughput data above has been extracted from the tool but it is always preferred and a best practice to use the throughput data from the server.

0 comments:

Post a Comment