You are on page 1of 44

SCENARIOS:

Creating, Running &


Analyzing Load Tests
Objectives

In this lesson, you will learn:

• The elements that make up a load test


• How to create and run a LoadRunner Scenario
• The LoadRunner scenario execution process
• How to analyze load test results
Key Terms Used in This Course

LoadRunner
Scenario
The elements that define a load test,
such as:
host
scripts
machines

virtual users

results run-time
location settings
Creating a Scenario

LoadRunner
Controller

Vusers Scripts Vusers Scripts

Server(s)

Host 1 Host 2
The LoadRunner Controller
• Before scenario execution
– creates scenario
– sets up run-time configuration

• During scenario execution


– runs many Vusers simultaneously
– controls each Vuser (initialize, run, pause, stop)
– displays execution status of each Vuser
– displays messages from each Vuser
– monitors server resources

• After scenario execution


– collects performance data
– launches the Analysis tools
– helps to analyze system performance
The Controller Directs Vusers

Vusers

Run Agent
Stop
Initialize

Remote
Load Command
Launcher

Host machine

Controller
Running a Scenario

1 - Make sure that Remote Command Launcher is


active on all hosts
2 - Specify the directory for storing execution results
– network drive
– accessible to all hosts
3 - Initialize Vusers
4 - Run Vusers
LoadRunner Expert Workflow
“Zooming In”

Phase 1 Phase 2 Phase 3 Phase 4 Phase 5


Analyze Tune
Plan Load Create Web Create Run
System System Based
Test Virtual Users Scenarios Scenarios
Under Load on Analysis

CREATE SCENARIOS
3.1 Define hosts
3.2 Connect hosts
3.3 Define Vuser scripts
3.4 Add Vusers
VuGen Creates a .usr File
Example Transaction Profile
TYPICAL WEB SERVER DATABASE RISK of
TRANSACTION PEAK DAY
DAY ACTIVITY ACTIVITY FAILURE
Log in

70/hr 210/hr Heavy ✓ Light High ✓
Create new
account 10/hr 15/hr Moderate Moderate Low

Create order ✓
130/hr 180/hr Heavy ✓ Heavy ✓ Mod
.

Update order 20/hr 30/hr Moderate Moderate High

Ship order 40/hr 90/hr Moderate Heavy ✓ High ✓

create_order

create_order.usr
3.4 - Add Vusers
Vusers Tab of the Controller

Host
Script
Machines
Initialize/ Names
run Vuser

Vuser
status
Controller Tabs
• Hosts tab
– all available hosts and their connection
status

• Scripts tab
– paths to all available Vuser scripts and the
script type

• Vusers tab
– displays all of the Vusers in a group

• Online tab
– displays monitors and graphs in real time
LoadRunner Expert Workflow
“Zooming In”

Phase 1 Phase 2 Phase 3 Phase 4 Phase 5


Analyze Tune
Plan Load Create Web Create Run
System System Based
Test Virtual Users Scenarios Scenarios
Under Load on Analysis

RUN SCENARIOS & ANALYZE RESULTS


4.1 Verify that Vusers run concurrently
4.2 Isolate Top Time transactions
4.3 Run full load test
4.4 Isolate hardware and software limitations
5.0 Analyze system under load (after each run)
Scenario Execution Process

Objective Explanation # of Vusers


A. This must pass before load
4.1 Verify that Vusers testing can begin 3-5
run concurrently B. Parameterized data must work
under concurrent usage
4.1 Verify that Vusers Run Concurrently
Run-time Settings

Run-Time Settings tab Recommended


Log select Extended log
check Parameter substitution
check Data returned by server
Performance check Enable checks during script execution
General check Define each action as a transaction
check Define each step as a transaction
4.1 Verify that Vusers Run Concurrently
LoadRunner Transaction Analysis

Transaction
name

• Use Filter to change transaction


displayed in graph
4.1 Verify that Vusers Run Concurrently
Transactions per Second (Failed)

3 transactions failed at 8
seconds, and 2 transactions
failed at 9 seconds

All 5
transactions
failed.
• This graph is a quick way to find
out if any transactions failed
4.1 Verify Vusers Run Concurrently
Failed Transactions by Vuser

I need to check the


output logs of Vusers
3, 11, and 12.
4.1 Verify Vusers Run Concurrently
Vuser Output Log
• LoadRunner produces an Vuser number
output log for each Vuser
when logging is enabled
• Included in the log:
– error messages
– parameter substitution
– transaction statuses

• Open the Output Logs


for the Vusers which
had errors
Scenario Execution Process

Objective Explanation # of Vusers


A. This must pass before load
4.1 Verify that Vusers testing can begin 3-5
run concurrently B. Parameterized data must work
under concurrent usage

4.2 Isolate Top Time These point to bottlenecks in 20%


transactions the system
Key Terms Used in This Course

Top Time
Transaction
A LoadRunner transaction which
requires significantly more than the
average time to complete, irrespective
of load. This creates a bottleneck.
Automatic Transactions
• Measure performance of every test step
• Compare individual steps to each other
• Compare individual steps to an entire business
process
Steps
12 sec
1 sec
9 sec
Complete
12 sec
business
1 sec
process
21 sec
19 sec 1 minute 19 seconds total

4 sec
4.2 Isolate Top Time Transactions
Run-time Settings

Automatic
Transactions show
up only in the
Controller’s graphs
and reports, not in
VuGen’s Execution
Log.

Run-Time Settings tab Recommended


Log select Standard log
Performance check Enable checks during script execution
General check Define each action as a transaction
check Define each step as a transaction
4.2 Isolate Top Time Transactions
Transaction Performance

Spikes indicate that


the Top Time transaction
is browse.
Scenario Execution Process

Objective Explanation # of Vusers


A. This must pass before load
4.1 Verify Vusers run testing can begin 3-5
concurrently B. Parameterized data must work
under concurrent usage

4.2 Isolate Top These point to bottlenecks in 20%


Time the system
transactions

4.3 Run full load test Verify that the system functions 100%
under the expected load
4.3 Run Full Load Test
Set Up Monitoring Options
• Check Auto start at scenario run
• Check Send errors to the output window
(otherwise pop-ups interrupt the run)
4.3 Run Full Load Test
Set Up Monitoring Tools
How often
is data read
from
cache? How
OBJECT COUNTER many data
requests can't
Cache Copy Read Hits % be fulfilled by
Data Map Hits % virtual
memory?
Memory Page Faults/sec
How busy
Server work Bytes Transferred/sec is server
Total Bytes/sec sending data
queues to clients?
System % Total Processor Time
File Data Operations/sec
How
often is
How server busy
often does (not waiting)
server Read ?
or Write?
4.3 Run Full Load Test
Runtime Settings
• Checks
Getting
Logging
Allows
Better these
are good of
emulates
testing
uses for
testing
measurements
the
realVuser,
resources
more
real user is the
world
that but
may befor
payoff unnecessary
all previous
may distort load
conditions
behavior
during load test
preparation
test results

RUN-TIME SETTING TAB RECOMMENDED


Log select Disable logging
Network check Emulate modem speed, and enter expected speed
check Search for images and load them
Timing check Enable automatic think time (Min/Max times =1000)
Performance uncheck Enable checks during script execution
General check Define each action as a transaction
check Define each step as a transaction
4.3 Run Full Load Test
Percentile

50% of the
transactions completed
in 57 seconds or less
4.3 Run Full Load Test
Throughput

NOTE: The graph data spreadsheet display can be turned on and off
4.3 Run Full Load Test
Hits per Second

For each iteration,


server throughput
remained fairly constant but
grew less synchronized,
resulting in lower peaks.
4.3 Run Full Load Test
Unfiltered Transaction Performance

Without a filter,
I can directly compare
the performance of all
transactions.
4.3 Run Full Load Test
Filtered Transaction Performance

With a filter, I can


isolate and view
specific transaction
response times.
4.3 Run Full Load Test
Transaction Distribution

Great! 21 of the
25 total transactions
took less than
6 seconds.
4.3 Run Full Load Test
Transaction Performance Summary

This report is another way


to find failed transactions
Scenario Execution Process

Objective Explanation # of Vusers


A. This must pass before load
4.1 Verify that Vusers testing can begin 3-5
run concurrently B. Parameterized data must work
under concurrent usage

4.2 Isolate Top Time These point to bottlenecks in 20%


transactions the system

4.3 Run full load test Verify that the system functions 100%
under the expected load

4.4 Isolate hardware Learn whether the system is 100% +


and software scalable by running more than
limitations
100% load
4.4 Isolate Hardware and Software Limitations
The “Overdrive” Test
• Determine whether your system is scalable to
increased load
• Typical test is 120% of full load
• Determine the limit of load that can be handled
before more resources are required
• Use the same run-time settings and analysis
tools as for a full load test
Cross Scenario Graphs

120 Vusers

100 Vusers

This comparison shows


the performance degradation
between 100 and 120 Vusers.
Cross Scenario Graphs

This comparison
shows that adding more
users didn’t slow
the system much
Refresh Databases to Original State

If databases are not refreshed


• Vusers might not play back
• Load test results might be
inaccurate
Summary

• The LoadRunner Controller helps you to:


– create scenarios
– run the Vusers
– collect performance data
• Scenarios consist of hosts, scripts, and Vusers
• Follow the LoadRunner Scenario execution
process
• Initialize Vusers before running them
• Analyze load test depending on the objective
LoadRunner Expert Workflow
Summary
Phase 1 Phase 2 Phase 3 Phase 4 Phase 5
Analyze Tune
Plan Load Create Web Create Run
System System Based
Test Virtual Users Scenarios Scenarios
Under Load on Analysis

1.1 Get system usage 2.1 Record user 3.1 Define hosts 4.1 Verify that Vusers
information actions run concurrently
3.2 Connect hosts
1.2 Document 2.2 Add LoadRunner 4.2 Isolate top time
3.3 Define scripts
business process transactions transactions
properties 3.4 Add Vusers
2.3 Parameterize 4.3 Run full load test
1.3 Determine which data 4.4 Isolate hardware
fields to 2.4 Add verification and software
parameterize checks limitations
1.4 Establish which 2.5 Verify correct
data to use execution
Lab Exercise
Cross Scenario Graphs

120 Vusers

100 Vusers

This comparison shows


the performance degradation
between 100 and 120 Vusers.