How to design workload model for stress testing?

  In this blog post, we will see how to design workload model for stress testing. Every person in this world has a breaking point. In short, there is a limit for everything. It applies for everything. Similarly, servers also has a breaking point, beyond a particular limit it will not behave as expected. It is much important to identify the breaking point before application goes live.

See the definition of Stress testing in my earlier post Types of Performance Testing. Stress Testing validates the stability of the system and it identifies the breaking point by overloading the concurrent users.

We will see what the appropriate approach for stress testing is. Following are the entry criteria for stress testing.

  • Hardware configurations
  • Network configurations
  • Number of Concurrent Users derived from Load Testing i.e. peak load
  • Identified critical scenarios

It is best to refer hardware and network configuration, as it will help to plan the stress testing to avoid any disaster.

Consider a web application which publishes your post across social medias; total number of concurrent during peak business hours (from 11:00 to 13:00) per day is 1500. Following are the list of transactions performed by the users.

  1. Login
  2. Click on Write Post link
  3. Write Post (140 characters)
  4. Submit Post
  5. Logout

In order to identify the breaking point of the system, first you load the server with 1500 concurrent users i.e. at A as shown in below figure.

How to design workload model for stress testing - qainsights

Load the server with 1500 concurrent users gradually. Once it reached, increase the concurrent users to 1600 and observe the script execution. Monitor the graphs between Response Time vs. Number of Virtual Users (VUsers), Throughput vs. Number of VUsers, and Errors vs. Number of VUsers. These graphs alerts the breaking point.

If everything goes fine for 1600 VUsers, increase it to 1700 VUsers, 1800 VUsers and so on till you face any abnormal behavior of the server. At some point, i.e. in our scenario at point B say at 2000, there are abnormal behavior such as Error 404, Error 500 errors occurred during the execution.

It is ideal to stop the execution either gradually or immediately. Because further execution give no valid result for analysis. In this case, breaking point of the server is 2000, i.e. 2000 VUsers can login concurrently and access the website. But beyond 2000, server will not be able to handle those many users.

To summarize, first is to gather entry criteria and start loading the server and incrementing it, till it breaks the system.

How to use performance center ?

 In this blog post, we will see about how to use Performance Center for Load/Stress Testing. HP Performance Center is a web based application which enables performance test engineers to execute load/stress testing.

The main advantage of Performance Center is any number of users can access, plan, execute and analyze the results.

The knowledge of LoadRunner components such as VuGen, Controller and Analysis is preferable. Now we will see steps involved to conduct load / stress testing using Performance Center. If you noticed, I did not mention any version number of Performance Center. If I mentioned version here, this blog post will be outdated in near future. Here we are going to see core steps to conduct load / stress testing using Performance Center.

Steps involved in Performance Center to conduct Load / Stress Testing

a. Creating scripts using VuGen

b. Uploading scripts to Performance Center

c. Host Machines

d. Creating Scenarios

e. Booking Slots

f. Conducting Load / Stress Testing

g. Analyze Results

a. Creating scripts using VuGen

From Performance Center, VuGen tool can downloaded for creating scripts for the identified critical scenarios. Recording, Playback, enhancing scripts and unit test will yield base lined VuGen script for testing.

b. Uploading scripts to Performance Center

Base lined scripts should be uploaded to Performance Center. Scripts should be uploaded in *.zip format this can be achieved thru File menu in VuGen.

c. Host machines

Before conducting load / stress tests, we will see about host machines which acts as Controller which manages the load / stress test. Load Generator which actually generate traffic by executing Virtual Users (VUsers). Controller + Load Generator which acts as Controller and Load Generator. Above details can be seen at Timeslot page.

d. Creating Scenarios

By clicking on New Load Test in Load Test page, one can create scenarios for Load / Stress testing. Under Design Group, test engineers can specify the number of load generators which can set either by number or by percentage.

Scheduler is used to specify the number of virtual users for the load / stress tests. It allows test engineers to specify the duration, ramp-up, ramp-down, steady state span and run mode. It displays an interactive schedule graph for the test engineers.

e. Booking slots

As I mentioned in first paragraph, Performance Center is a web based application. Test Engineers across geographical location will be able to conduct load / stress testing. It is much important to book the slots, so that no conflict will raise during execution.

Timeslot displays the availability of load generators, controllers and VUsers. Test engineers need to specify the time slot and the required hosts to conduct his/her load / stress test.

f. Conducting Load / Stress Testing

To execute load test, go to Scheduler and click on Start button to execute load / stress test or click on Run button against the load test. Performance Center scans for any errors. If everything is green, we can see the number of VUsers running, passed/failed transactions details, errors etc.

g. Analyzing the results

Once the test gets completed, we can collate and analyze the result. Results will be available in *.html, results.zip and rawresults.zip for analysis. Bottlenecks can be identified using correlating one or more graphs. The results can be downloaded and exported to Analysis tool for detailed analysis.

In next post, we will see about the best practices and the general errors that occurs during load / stress test.