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

Monday 4 August 2014

Begin Performance Testing

Overview

This simple performance document covers the basics of performance testing. This information may be useful for beginner who might be to start performance testing. 


What is performance testing?

The analysis of the effectiveness, speed of a software system under varied load in terms of throughput and response time is known as performance testing.

Types of performance testing:

1.      Load Testing
2.      Stress Testing
3.      Scalability Testing
4.      Capacity Testing

Before we begin to study about performance testing we need to understand following terms.
Load Testing – a measurement of the usage of the system. A server is said to experience “high load” when its supported application is being heavily trafficked. It is done to identify the application bottlenecks.
The purpose of load testing is to ensure that your application will have a good response time during peak usage.

Stress TestingIdea behind the stress testing to check how any system gets exhausted when load is increased substantially without adding any extra resource to handle such a high load. Failure due stress test may be or may not be attended but this test is done to identify the behavior of the system under stress.
Scalability Testing - Utilization of extra hardware resources to improve the response time is known as scalability.

There are two types of scalability.
  • Vertical Scalability
  • Horizontal Scalability
Vertical scalability – It is the ability to increase the capacity of existing hardware or software by adding resources - for example, adding processing power, RAM to a server to improve response time.
Horizontal scalability – It is connecting multiple servers so that they work as a single logical server to improve the response time.
We perform scalability testing to determine how effectively your Web site will expand to accommodate an increasing load. Scalability testing allows you to plan Web site capacity improvements as your business grows and to anticipate problems that could cost you revenue down the line. Scalability testing also reveals when your site cannot maintain good performance at higher usage levels, even with increased capacity.
Capacity Testing (Volume) - Capacity Testing is performed to determine maximum load limits that a system can handle to meet the desired business processing. You can define the capacity of the system under a suggested hardware and software configuration beyond which the system will fail.

A Process for performance testing

Performance testing you can do in following manner:
  • Complete the entire functional test to ensure that your application is working properly to perform the performance test.
  • Select a suitable tool for your application
  • Write test scripts to populate database sufficient amount of data.
  • Write test script to cover the main functionality and transaction of the application.
  • Run performance tests scripts to measure response time and throughput.
  • Then apply varying load as desired.
  • Run your performance tests again.
  • If response times are significantly larger for the second test, then something is wrong.
  • Once you have tested the application with varying load then compare their response times. These can be easily measured by load testing tools.
  • Now you can now interpret the results and make predictions based on the average response time of these tests and the resource utilization of the server during the tests.
  • After identifying problems area in the application you can make suggestions for optimization of the hardware and software resources.

Why we need Performance testing?

Load, Capacity, scalability and stress testing eliminates real time surprises and ensures that your web site will be able to perform this way under this much load. Without doing the performance testing it is very hard to know what might happen when your site has to perform under a heavy load.
There are following reasons which impose you to carry out the performance testing putting you site to real world.
  • To know how much traffic your site can handle.
  • To know what end users will experience when traffic becomes heavy.
  • Helps to Maximize Your Application Performance -
Performance testing can measure performance response times and availability from the end-user’s perspective. This allows you to quickly identify performance problems and keep your end users happy under all load conditions.

  • Pinpoint Performance Bottlenecks -
You can watch your web application respond to load testing and observe bottlenecks in action. Real-time performance monitors allow the experts to instantly identify bottle-necks and discuss these findings with you. Following the test, you can view reports online, complete with performance graphs.

How to improve Performance of your application?

You know that performance of any application directly leads to reduce response time and can be improved by following ways.

  • Performance can be increased through software optimization.
  • Cut the average transaction response time.
  • Increase your system maximum throughput (KB/sec).
  • By doing load balancing and server clustering.
  • Eliminating memory leaks
  • Optimize database query handling
  • Improve network bandwidth
  • Improve network routing problem
  • Remove deadlock problem relating to a single threaded process.

Definitions related to performance testing

Response Time – It is the time taken between requests and received the responses for same request.
Latency - It is the increases in response delay beyond the time desired for an operation for any system. It can also be described as delay in desired response time.
Throughput It is a measure of amount of data processed by any system over a period of time. Throughput can be measured in kbps, mbps or gbps.
Hits/SecondIt is a measure of traffic flow to a server every second.
Virtual user - Virtual User (VU) is an automated testing tool that allows a computer to emulate multiple real users from a single computer system.
TransactionIt is transaction usually means a sequence of information exchange and related work that is treated as a unit for the purposes of satisfying a request.
CPU Load - The CPU load for a system is the number of processors in the system.
CPU utilization - Monitoring counters such as %Processor Time and Total Processor Time will give you a bigger picture of how your CPU is handling the load. Your processor should not sustain a level of more than 80 percent for either of these counters. If it does, you need to look at upgrading your processor or adding another processor, if the system allows for it.

Memory Leak – It is the gradual loss of available computer memory when a program repeatedly fails to return memory that it has obtained for temporary use. As a result, the available memory for that application or that part of the operating system becomes exhausted and the programs can no longer function. For a program that is frequently opened or called or that runs continuously, even a very small memory leak can eventually cause the program or the system to terminate. A memory leak is the result of a program bug.
Some operating systems provide memory leak detection so that a problem can be detected before an application or the operating system crashes.
Some program development tools also provide automatic "housekeeping" for the developer. It is always the best programming practice to return memory and any temporary file to the operating system after the program no longer needs it.

Load balancing - It is the distribution of the load from a single web server to multiple servers as single logical unit.

To achieve this you can either distributing the load:
1)     Evenly among all the servers in the cluster
2)     Load can be distributed by optimize the load on the server.
Server cluster It is a group, combination of web server and database. Clustering can be done with one or more servers at from and single database at backend.

Performance Testing Tools

Most commonly used automation testing tools are:
HP - Load runner, Astra load
Segue – Silk Performer
Rational –Performance Studio, Performix, Robot (VU)
Empirix – e-Test, e-Load
Microsoft – WCAT (Web Capacity Analysis Tool), WAST (Web Application Stress Tool)
Compuware – QALoad
Cyrano – Open STA
RadView - WebLoad