Showing posts with label Performance Testing. Show all posts
Showing posts with label Performance Testing. Show all posts

Monday, May 26, 2014

Load Testing - 10 Points to remember

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

Tuesday, October 30, 2012

Web Page speed testing tools


1. Page Speed
Test Website Speed
Google’s Page Speed is an open-source Firefox add-on, with which you can test the speeds of current web pages and get suggestions on how to improve them.
The Page Speed need to be used with another Firefox add-on Firebug .
2. Yahoo! YSlow
Test Website Speed
Yahoo! YSlow is also a Firefox/Firebug add-on, and it will also test website speed and offer suggestions for improving the page’s performance.
Usually, if your Page Speed score is high, so your YSlow grade will be, and vice versa.
3. GTmetrix
Test Website Speed
GTmetrix will offer website speed testing results from both Google Page Speed and Yahoo! YSlow, and it will also offer some recommendations for how to improve the website speed.
The GTmetrix results may be a little different from those of Page Speed or YSlow, but you can test and compare up to four websites at a time.
4. Pingdom Tools
Test Website Speed
Pingdom Tools is for you to test the load time of a web page.
You can view the load time of every element on the web page and find out the bottlenecks.
5. Web Page Analyzer
Test Website Speed
Web Page Analyzer will calculate page size, composition and download time for the web page of the URL you enter, it will also offer advice on how to improve page load time.
6. WebPagetest
Test Website Speed
With WebPagetest, you can test one website and get detailed recommendation, or you can test several websites and compare them with each other.
When testing one website, you can select the test location, choose the IE browser or connection versions, keep test results private, and so on.
7. Webmaster Tools
Test Website Speed
Log in your Webmaster Tools, open the Site Performance page of Labs, then you will see the loading time of your website in a chart, and you will also get some suggestions for how to make the site faster.
8. Zoompf
Test Website Speed
Besides to test website speed, Zoompf will also list all the issues in detail and offer related references for how to fix them.
9. Show Slow
Test Website Speed
Show Slow will also show you both YSlow grade and Page Speed score for the web page of the URL you enter.
You need to register to add the URL of the website your want to test.
10. Which Loads Faster
Test Website Speed
The Which Loads Faster website will test and compare the loading speed of two websites or web pages.


Wednesday, February 15, 2012

Performance / Load / Stress ......types of Testings


About Performance & Load Testing



Sl
No
Title
Title
1.
Introduction

2.
Product or application performance measuring types
3.
How
4.
5.
List of Tools

6.
OpenSTA

7.
WebLoad

8.
JMeter

9.
It is opensource tool, can be used for functional, load & webservice testings.  It can be integrated with Selenium, JUnit, SoapUI & many other tools.
10. 
Apache benchmarking ( tools & articles)
11

12

13

14