Thursday, June 9, 2011

Load Testing Approach

Load Testing Using Jmeter
  • Identify Requirements
  • Identify load-critical scenarios
  • Identify the target load levels
  • Implement test Design
  • Design specific tests
  • Run tests
  • Analyze the results
Identify Load Requirements
Load testing helps to identify the maximum operating capacity of an application as well as any bottlenecks that might interfere with its operating at capacity. As you begin load testing, it is recommended that you start with a small number of virtual users ( by giving 1 user in the Thread Group) and then incrementally increase the load from normal to peak (by giving the number of users as 500 in the Thread Group) .

We can then observe how our application performs during this gradually increasing load condition. Eventually, we will cross a threshold limit for our performance and load objectives. For example, we might continue to increase the load until the server processor utilization reaches 75 percent, or when end-user response times exceed 5 seconds. 

Identify the load-critical scenarios
1. Identify the workload profile for distributing the entire load among the key scenarios.
2. Identify the metrics that you want to collect in order to verify them against your performance objectives.

By using an iterative testing process, these steps should help you achieve your performance objectives.
We will create a Test Plan(with any website) in order to demonstrate how we can configure the Test Plan to include load testing capabilities. The modified Test Plan will include these scenarios:
  • Access the Home page
  • Access the Careers page
  • Access the Contact page etc.....
Implementing Load Test Cases in Jmeter
1. Record the Identified Test cases as described in Functional Test part.
2. Now change the No of threads group as given in test cases as like showing in figure given below.


Running the Test:
Once all the Listeners are added, the Test Plan is Run and results as captured by the Listeners which can be saved and reproduced at a later time.

Analysis on Load Testing Results :-
Analyze the metric data captured during the tests as below:

Aggregate Graph:
The aggregate graph is similar to the aggregate report. The primary difference is the aggregate graph provides an easy way to generate bar graphs and save the graph as a PNG file. By default, the aggregate graph will generate a bar chart 450 x 250 pixels.


# Label - The label of the sample. If "Include group name in label?" is selected, then the name of the thread group is added as a prefix. This allows identical labels from different thread groups to be collated separately if required.
# Samples - The number of samples with the same label
# Average - The average time of a set of results
# Median - The median is the time in the middle of a set of results. 50% of the samples took no more than this time; the remainder took at least as long.
# 90% Line - 90% of the samples took no more than this time. The remaining samples at least as long as this. (90 th percentile)
# Min - The shortest time for the samples with the same label
# Max - The longest time for the samples with the same label
# Error % - Percent of requests with errors
# Throughput - the Throughput is measured in requests per second/minute/hour. The time unit is chosen so that the displayed rate is at least 1.0. When the throughput is saved to a CSV file, it is expressed in requests/second, i.e. 30.0 requests/minute is saved as 0.5.
# Kb/sec - The throughput measured in Kilobytes per second



The aggregate graph provides an easy way to generate bar graphs and save the graph as a PNG file. By default, the aggregate graph will generate a bar chart 450 x 250 pixels.
Here, as showing in figure there are two exis:
  • X- Axis: It shows the requests which is run by Jmeter 
  • Y- Axis: It shows the time in milliseconds


Summary Report :
The summary report creates a table row for each differently named request in your test. This is similar to the Aggregate Report , except that it uses less memory. The throughput is calculated from the point of view of the sampler target (e.g. the remote server in the case of HTTP samples). JMeter takes into account the total time over which the requests have been generated. If other samplers and timers are in the same thread, these will increase the total time, and therefore reduce the throughput value. So two identical samplers with different names will have half the throughput of two samplers with the same name. It is important to choose the sampler labels correctly to get the best results from the Report.

View Result Table:
This Visualizer creates a row for every sample result. Like the View result Tree this Listener uses a lot of memory space.

Summary:
This will provide visual means for us to understand the capabilities of JMeter tools that support Load testing, as we directly wrote and implemented a JMeter script. We have demonstrated building a Test Plan to contain Load testing by incorporating various essential JMeter components, particularly the 'Aggregate Graph' element and 'Summary Report' Listener.


No comments: