Click here to Skip to main content
Click here to Skip to main content

Load Testing in 10 Steps

, 14 Jul 2010
Rate this:
Please Sign up or sign in to vote.
Most of the software companies are running Load Testing on their products. Load testing is one of the most important testing types today....

Introduction

Most of the software companies are running Load Testing on their products. Load testing is one of the most important testing types today. On the 6/6/2008 Amazon web site crashed for two hours, it would have been difficult to calculate the exact amount that outage would cost Amazon, because customers could come back later for purchases but the stock closed down 4.6 percent at $80.63. Everyone thought "They know how to handle load".

In this article, I'm not going to talk about Load Testing tools or advanced testing techniques, but rather, I would like to talk about 10 basic steps that are the foundations for creating a good, precise and powerful Load Test suite.

Step 1 - Identify Objectives

The purpose of this step is to identify and write the performance objectives of your application. The key question you should ask yourself is:
“How should my application behave under load?”

The main parameters we should consider are:

Response time - The time that would take the application to display a certain output or perform a certain calculation. Example: the product catalog must be displayed in less than 3 seconds.
Throughput – The rate of successful message delivery over a communication channel. Example: the system must support 100 requests per second.
Resource utilization- A frequently overlooked aspect, Resource Utilization defines how much resource your application is consuming, in terms of CPU, memory, disk I/O, and network I/O.
Maximum User Load- Determine how many users can run on your testing hardware configuration.

This is probably the most important step!

Step 2 - Identify Key Scenarios (or profiles)  

what are scenarios?
Scenarios are anticipated user paths that generally incorporate multiple application activities.

How do you identify scenarios?
Key scenarios are those for which you have specific performance goals or those that have a significant performance impact. These scenarios represent business activity of users over time.

For example: Open 'about window' will take less resource than perform 'buy' action.

The “Buy” action, as opposed to “Open about window”, will involve multiply actions like: SQL, Credit Card validation, IIS 

Step 3 - Identify the workload

Identify the distribution / ratio of the work - For each key scenario, identify the distribution / ratio of the work. The distribution is based on the number of users executing the scenario (according to their profile).
For an existing application this information can be provided from IIS log/counters as described in step 1.
For a new application this information can be based on market research, historical data, market trends and prototypes.

Calculate the users load per scenario - Based on the previous data; calculate the maximum possible concurrent users for the application. Using the work distribution for each scenario calculate the % user load per key scenario. For example, the distribution of load for key scenario could be similar to that shown in the following table. 

1.png

Step 4 - Identify Metrics

Metrics are a derivative of your performance objectives. They are used to measure your application’s real time performance in comparison with your performance objectives. In addition, they also help you to identify problems and bottlenecks within your application.

Network-specific metrics: This set of metrics provides information about the overall health” and efficiency of your network, including routers, switches, and gateways.

System-related metrics: This set of metrics help you identify the resource utilization on your server. The set includes CPU, memory, disk I/O, and network I/O metrics.

Platform-specific metrics: Platform-specific metrics are related to software that is used to host your application, such as the .NET Framework common language runtime and ASP.NET-related metrics.

Application-specific metrics: These include custom performance counters embedded in your application code that monitors the application’s “health”. You might use custom counters to determine the number of concurrent threads waiting to acquire a particular lock or the number of requests queued to make an outbound call to a Web service.

Service level metrics: Service level metrics can help to measure overall application throughput and latency, or they might be tied to specific business scenarios. 

2.png

 Step 5 – Pick Load Test Tool

Before writing your Tests we need to pick the right load testing tool.

In order to select the proper tool for us and our application, we will need to perform a research; Load testing tools requires specific knowledge and each tool has his advantages and disadvantages.

Everyone can learn how to use a load testing tool, however, different tools are better for different purposes, selecting the right can have a significant impact on our testing process.

Most tools have very good functionality and advanced features. One of the first parameters you would use for comparison of tools is the user limit (or lack thereof) and the scalability of that limit. As a rule of thumb try to avoid tools that cap the amount of users simulated via licensing (More users = more money).

For example, Team System Test Edition has no User Limit, so we can simulate as many users as our hardware allows us to.

Personally, I'm using Microsoft’s Team System; if you have picked this tool you may contact me for assistance.

Step 6 - Create Test Cases

  • What is a test case?
    • A group of activities involved in a scenario/user profile.
    • The test cases are created based on the scenarios and the profile mix identified in the previous steps.

Each test case should include the expected results in such a way that each test case can be marked as a 'pass' or 'fail' after execution. 

Test Case: Search phone owner 

3.png 

Create an automated test and set a specific load configuration for it.
Example: 400 users for 1 hour

And load test expected results for Test Case: Search phone owner 

4.png

Step 7 – Prepare\Understand Your Load Environment

Our setup environment should duplicate the architecture of our production environment as closely as possible.

It is important to simulate the load on environment similar to our production because even the smallest hardware or configuration difference can have a big impact on our results.

Creating a testing environment which duplicates the production environment exactly can be hard and isn’t always feasible, but we need to do our best, because this environment will help us estimate the load results of our product.

We must understand the hardware limits of our environment and find the bottlenecks before starting the Test.

Example: I have created a load environment with 2 computers that will run 10,000 concurrent users, the ISP provides 1Mbps.
Each user will open browser and perform a search for dynamic word in
www.live.com.

Opening 5000 browsers on one machine?
I've never tried it but I'm sure that CPU usage will be 100% for a while.
When CPU usage is 100% the computer is not creating the needed load and we will get false information so this is our first bottleneck.

Do you think 1Mbps is enough bandwidth for 10,000 users?
No! 10,000 users cannot work together on 1Mbps bandwidth, this is the second bottleneck. 

Step 8 – Run It Step by Step

Begin load testing with small number of users distributed against the user profile, and then increase the load incrementally. It is important to have sufficient time between each step, so that the system has enough time to stabilize before the next set of user connections executes the test case.

Incrementing the number of users slowly will make it easier to find the exact point/threshold where the system crashes or hangs due to load. Starting the tests with a large number of simulated users will prevent us from detecting that point/threshold efficiently.

Run the load test in cycles. Each cycle should achieve a certain load increment, and should have analysis and fixing time in between. Check the metrics for each cycle, and document them, so you can show evidence that the loads was achieved already. 

Step 9 - Run

After successfully implementing step 8, the system is considered stable, and we can run the full Load Test as mentioned in the preplanned workload.

Before running the test we must make sure we are monitoring both the computer running the load test and the computer taking the load. This will help us find bottlenecks on both sides of the test.

Team System Test Edition can perform such dual monitoring.

If your load tool doesn't have this ability you can use Windows Performance Monitor (Perfmon), the disadvantage of using Perfmon is that you will have two or more separated  graphs you need to analyze. 

5.png

Step 10 - Analyze and Evaluate the Results

After each run, and of course after the full run, we analyze the results and check against the metrics and make sure our objectives were achieved.

We save each run Results and compare with other runs, in this way we may notice improvement or deterioration of the performance and load of your application.

Make sure you can share your load and performance test results and evaluations - performance and load testing is a serious discipline, but it also needs to be understood by other key business disciplines such as business operations, senior management and maybe finance.

Try to simplify things so it will be understood by those specific populations: It helps to have some kind of graphical reporting ability (in the tool) that allows us to share our test results with other parts of our organization.

My Rule is - The results from one environment aren’t necessarily equal to the results of another.

Can you say that 6.png I say maybe…

Example: Production environment has 10 computers and the Load environment has 2 computers, the load test showed that 2 computer can holds more the 1000 users, so 10 computer can holds approximately 5000 users? NO!

7.png

So why perform load testing if the results are inconclusive to production?

Load Test helps you to estimate the behavior of the application under load

Summary

That being said, I'm sure that for expert performance test engineers, the above rules of thumb are obvious – you have tried them in a trial and error situations. For all the other testers who would like to know how to start a performance and load test, and make things done, I hope I have explained in simple enough words, what are the basic step by step actions that I suggest to follow in order to create a good, precise and powerful Load Test suite. Good luck!  

Points of Interest 

Team System Team Editionhttp://msdn.microsoft.com/en-us/teamsystem  

Windows Performance Counters - http://msdn.microsoft.com/en-us/library/aa373083(VS.85).aspx

Shai's Bloghttp://blog.microsoft.co.il/blogs/shair

License

This article, along with any associated source code and files, is licensed under The Microsoft Public License (Ms-PL)

Share

You may also be interested in...

About the Author

Shai Raiten
Architect Sela
Israel Israel
Shai Raiten is VS ALM MVP, currently working for Sela Group as a ALM senior consultant and trainer specializes in Microsoft technologies especially Team System and .NET technology. He is currently consulting in various enterprises in Israel, planning and analysis Load and performance problems using Team System, building Team System customizations and adjusts ALM processes for enterprises. Shai is known as one of the top Team System experts in Israel. He conducts lectures and workshops for developers\QA and enterprises who want to specialize in Team System.
 
My Blog: http://blogs.microsoft.co.il/blogs/shair/
Follow on   Twitter

Comments and Discussions

 
QuestionCredibility of Visual Studio Ultimate 2010 Load Test PinmemberOmer Zia25-Sep-13 22:12 
AnswerRe: Credibility of Visual Studio Ultimate 2010 Load Test PinmemberOmer Zia26-Sep-13 0:12 
AnswerRe: Credibility of Visual Studio Ultimate 2010 Load Test PinmvpShai Raiten28-Sep-13 19:22 
GeneralRe: Credibility of Visual Studio Ultimate 2010 Load Test PinmemberOmer Zia30-Sep-13 1:10 
QuestionLoad Test PinmemberMember 964906218-Feb-13 22:53 
GeneralMy vote of 5 Pinmemberjawed.ace7-Sep-11 23:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web01 | 2.8.140827.1 | Last Updated 14 Jul 2010
Article Copyright 2010 by Shai Raiten
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid