Beruflich Dokumente
Kultur Dokumente
8.1
Student Workbook
EDUCATION DEVELOPMENT
LR81-STUDENT-01D
All rights reserved. All text and figures included in this publication are the exclusive property of Mercury
Interactive Corporation or its licensors, and may not be copied, reproduced, or used in any way without the express
permission in writing of Mercury Interactive. Information in this document is subject to change without notice and
does not represent a commitment on the part of Mercury Interactive.
This document may also contain registered trademarks, service marks and/or trade names that are owned by their
respective companies or organizations. Mercury Interactive Corporation disclaims any responsibility for specifying
which marks are owned by which companies or organizations.
If you have any comments or suggestions regarding this document, please send them via
http://www.merc-training.com/feedback
1-1
Mission-Critical Transactions.......................................................................................... 2-9
Business Processes to Record:
Heavy Throughput Transactions.................................................................................... 2-10
Business Processes to Record
Dynamic Content ........................................................................................................... 2-11
Business Process Profile ................................................................................................ 2-12
Classroom Activity ........................................................................................................ 2-13
Measuring Steps............................................................................................................. 2-14
Measure Steps by Defining Transactions ...................................................................... 2-15
Preferred and Unacceptable Response Times................................................................ 2-16
Documenting User Steps and Input Data....................................................................... 2-17
Determine Valid Test Data to Use ................................................................................. 2-18
Valid Test Data Sources ................................................................................................ 2-19
What is Think Time? ..................................................................................................... 2-20
Navigation Time Reflects User Pauses.......................................................................... 2-21
What is a Concurrency? ................................................................................................. 2-22
Application Concurrency ............................................................................................... 2-23
Business Process Concurrency ...................................................................................... 2-24
Transactional Concurrency ............................................................................................ 2-25
User Profile .................................................................................................................... 2-26
Peak Load ...................................................................................................................... 2-27
Where are Your Customers Located? ............................................................................ 2-28
Transcontinental Remote Customers ............................................................................. 2-29
Quantifying Load Testing Goals.................................................................................... 2-30
LoadRunner Expert Workflow -
Analyze the System ....................................................................................................... 2-31
Analyze the System Under Test..................................................................................... 2-32
Understanding the System Components ........................................................................ 2-33
Business Process Mapping to Infrastructure Components ............................................ 2-34
Monitoring Application Components ............................................................................ 2-35
Planning System Monitoring ......................................................................................... 2-36
About the Test Environment.......................................................................................... 2-37
Benchmarking Run ........................................................................................................ 2-38
Summary........................................................................................................................ 2-39
Exercise: Planning an Effective Load Test.................................................................... 2-40
Installation
LoadRunner Expert Workflow - Installation ................................................................... 3-2
Where Do I Start? ............................................................................................................ 3-3
Where to Install Each Component ................................................................................... 3-4
Installing VuGen.............................................................................................................. 3-5
Installing the Controller ................................................................................................... 3-6
1-2
Installing Load Generators............................................................................................... 3-7
Install Load Generators to Reflect Customer Base.......................................................... 3-8
WAN Emulation .............................................................................................................. 3-9
Why Emulate Remote Users Performance?................................................................... 3-10
WAN Emulation - procedure ......................................................................................... 3-11
Installing Analysis ......................................................................................................... 3-12
Putting it all Together .................................................................................................... 3-13
Minimum Hardware Recommendation ......................................................................... 3-14
Need for Remote Infrastructure ..................................................................................... 3-15
Verifying Connectivity to a Load Generator ................................................................. 3-16
Troubleshooting Generator Connectivity Issues............................................................ 3-17
Summary........................................................................................................................ 3-18
Exercise: Installation...................................................................................................... 3-19
Introduction to Scenarios
LoadRunner Expert Workflow - Understanding Scenarios ............................................. 4-2
What is a Scenario ........................................................................................................... 4-3
The LoadRunner Controller............................................................................................. 4-4
Scenario Outline - Examples ........................................................................................... 4-5
Creating a New Scenario ................................................................................................. 4-6
Select Vuser Scripts ......................................................................................................... 4-7
Vuser Groups ................................................................................................................... 4-8
Adding a Vuser Group ..................................................................................................... 4-9
Modifying the Vuser Group Settings............................................................................. 4-10
Manual vs. Goal-Oriented Scenarios ............................................................................. 4-11
Which Scenario Type to Choose? Example .................................................................. 4-12
Selecting Load Generators for your Scenario................................................................ 4-13
Adding a Load Generator .............................................................................................. 4-14
Defining a New Load Generator.................................................................................... 4-15
Connecting to a Load Generator .................................................................................... 4-16
Configuring Load Generator Settings............................................................................ 4-17
Assigning User Profiles to Load Generators ................................................................. 4-18
Assigning User Profiles to Load Generators - Example................................................ 4-19
Assigning Number of Vusers......................................................................................... 4-20
Summary........................................................................................................................ 4-21
Exercise: Introduction to Scenarios ............................................................................... 4-22
1-3
Run-time Settings Vary with Protocol............................................................................. 5-5
Accessing Run-time Settings ........................................................................................... 5-6
Run Logic ........................................................................................................................ 5-7
Configuring Run Logic - Example .................................................................................. 5-8
Pacing............................................................................................................................... 5-9
Log Settings ................................................................................................................... 5-10
Log Settings - Best Practices ......................................................................................... 5-11
What is Think Time? ..................................................................................................... 5-12
Enabling or Ignoring Think Time .................................................................................. 5-13
Configuring Think Time - Example .............................................................................. 5-14
Additional Attributes ..................................................................................................... 5-15
Miscellaneous Settings .................................................................................................. 5-16
Additional Settings for Web Vusers .............................................................................. 5-17
Additional Settings for Web Vusers - Examples ........................................................... 5-18
Scenario Run-time Settings - Defined ........................................................................... 5-19
Scenario Run-time Settings ........................................................................................... 5-20
Summary........................................................................................................................ 5-21
Exercise: Introduction to Scenarios ............................................................................... 5-22
Scenario Execution
LoadRunner Expert Workflow ........................................................................................ 6-2
About Running Scenarios ................................................................................................ 6-3
What is a Rendezvous Point?........................................................................................... 6-4
Rendezvous ...................................................................................................................... 6-5
Before You Run a Scenario ............................................................................................. 6-6
Executing Scenarios as a Team is Recommended........................................................... 6-7
Scenario Execution Process: Debug Run......................................................................... 6-8
What is a Top Time Transaction?.................................................................................... 6-9
Scenario Execution Process: Isolate Top Time Transactions ........................................ 6-10
Scenario Execution Process: Full Load ......................................................................... 6-11
Scenario Execution Process: Scalability Test ................................................................ 6-12
Best Practices ................................................................................................................. 6-13
Vuser Status - Under Controller Run Tab ..................................................................... 6-14
Initializing Vuser Groups............................................................................................... 6-15
Understanding Vuser Status........................................................................................... 6-16
Vuser Window and Vuser Log ...................................................................................... 6-18
Scenario Status - Controller Run Tab ............................................................................ 6-19
Scenario Errors .............................................................................................................. 6-20
Viewing Scenario Errors - Procedure ............................................................................ 6-21
Common Run Time Errors ............................................................................................ 6-22
Summary........................................................................................................................ 6-23
Exercise: Scenario Execution ........................................................................................ 6-24
1-4
Scheduling Scenarios
LoadRunner Expert Workflow ........................................................................................ 7-2
About Scheduling Scenarios ............................................................................................ 7-3
Configure Schedule Settings of the Scenario .................................................................. 7-4
Configure Scenario Start Time ........................................................................................ 7-5
Schedule by Scenario....................................................................................................... 7-6
Schedule by Group........................................................................................................... 7-7
Ramp Up .......................................................................................................................... 7-8
Ramp Down ..................................................................................................................... 7-9
Scenario Duration .......................................................................................................... 7-10
Scenario Duration - Best Practices ................................................................................ 7-11
Initialization ................................................................................................................... 7-12
What Happens When the Stop Button is Pressed? ........................................................ 7-13
Summary........................................................................................................................ 7-14
Exercise: Scheduling Scenarios ..................................................................................... 7-15
Performance Monitors
LoadRunner Expert Workflow ........................................................................................ 8-2
Transactions Are Not the Whole Story............................................................................ 8-3
The Value of Performance Monitors ............................................................................... 8-4
Using Performance Monitors........................................................................................... 8-5
Examples of LoadRunner Performance Monitors ........................................................... 8-6
Performance Monitors ..................................................................................................... 8-7
Selecting Online Monitors - Procedure ........................................................................... 8-8
License Information ......................................................................................................... 8-9
Set Monitoring Options ................................................................................................. 8-10
Set Monitoring Options - Procedure .............................................................................. 8-11
Configure Monitors........................................................................................................ 8-12
Configure Monitors Procedure ...................................................................................... 8-13
Monitor Measurements .................................................................................................. 8-14
Best Practices for Choosing Monitor Measurements .................................................... 8-15
Summary........................................................................................................................ 8-16
Exercise: Performance Monitors ................................................................................... 8-17
Results Analysis
Where did the Failure Occur? .......................................................................................... 9-2
Root Cause Analysis ........................................................................................................ 9-3
Did You Meet Your Goals............................................................................................... 9-4
Results Analysis - Setting the Stage ................................................................................ 9-5
Average Transaction Response Time .............................................................................. 9-6
1-5
Average Transaction Response Time Under Load .......................................................... 9-7
Transaction Response Time Percentile............................................................................ 9-8
Transaction Response Time Distribution ........................................................................ 9-9
Working with the Data................................................................................................... 9-10
Opening a New Graph ................................................................................................... 9-11
Drilling Down ................................................................................................................ 9-12
Setting Filters ................................................................................................................. 9-13
Analysis Session File Extensions .................................................................................. 9-14
Isolating the Network..................................................................................................... 9-15
Isolating the Network - Graph Analysis ........................................................................ 9-16
Isolating Network Issues................................................................................................ 9-17
Isolating Server Issues ................................................................................................... 9-18
Isolating Server Issues ................................................................................................... 9-19
Interpreting Graphs ........................................................................................................ 9-20
Time to First Buffer Breakdown.................................................................................... 9-21
Page Download Time Breakdown ................................................................................. 9-22
Use Auto Correlation Feature to Pinpoint Bottlenecks ................................................. 9-23
Auto Correlate - Time Range......................................................................................... 9-24
Auto Correlate - Correlation Options ............................................................................ 9-26
Displaying Analysis Reports ......................................................................................... 9-28
Displaying Analysis Reports - Procedure ...................................................................... 9-29
Summary........................................................................................................................ 9-30
Exercise: Results Analysis............................................................................................. 9-31
Project (Optional)
Building Effective Scenarios .......................................................................................... A-2
1-6
LoadRunner Controller Outside a Firewall .....................................................................C-4
LoadRunner Controller Outside a Firewall - cont. ..........................................................C-5
LoadRunner Solution .......................................................................................................C-6
LoadRunner Solution - Step 1 .........................................................................................C-7
LoadRunner Solution - Step 2 .........................................................................................C-8
LoadRunner Solution - Step 3 .........................................................................................C-9
Configure the Controller ................................................................................................C-10
Hardware and Software Recommendations...................................................................C-11
IP Spoofing
About IP Spoofing .......................................................................................................... D-2
........................................................................................................................................ D-3
The Routing of Web Client Requests is
IP-related......................................................................................................................... D-4
How are IP Addresses Used by Routing Tables? ........................................................... D-5
Routing Tables Use Destination Addresses to Find a Packet’s Next Step ..................... D-6
Web Servers Use the Client’s IP Address to Return Results.......................................... D-7
How are IP Addresses Used by Load Balancing Systems? ............................................ D-8
Load Balancing Systems Rely on the IP Address of the Client...................................... D-9
Virtual Users Generally Reside at a Single IP Address................................................ D-10
Unbalanced Load Modeling Causes Uncertain Test Results........................................ D-11
...................................................................................................................................... D-12
IP Spoofing Issues ........................................................................................................ D-13
IP Spoofing Issues ........................................................................................................ D-14
The IP Wizard ............................................................................................................... D-15
The IP Wizard ............................................................................................................... D-16
Add Intranet/LAN Addresses ....................................................................................... D-17
Add Internet Addresses................................................................................................. D-18
The IP Wizard ............................................................................................................... D-19
Implementing the IP Spoofer ........................................................................................ D-20
Implementing the IP Spoofer ........................................................................................ D-21
IP Spoofing Results in Well-Distributed Load Modeling ............................................ D-22
Summary....................................................................................................................... D-23
Class Evaluation Form..................................................................................................... 1-1
1-7
1-8
Introduction
Introduction
Objectives
After completing this chapter, you will be able to:
1-1
Introduction
Course Objectives
Welcome to the FUNDAMENTALS OF LOADRUNNER course. These materials are intended
for anyone who creates scenarios or runs load tests with LoadRunner. Both introductory
concepts like creating and configuring scenarios as well as advanced topics like results
analysis are covered.
• Assign scripts, run-time settings, performance monitors, load generators and Vusers
to a LoadRunner scenario based on your load testing goals.
Scalability, reliability, and responsiveness are crucial issues for any application.
Traffic volumes can change dramatically in a matter of seconds. Long waits,
sluggish performance, or errors can send customers to the competition. At the same
time, multi-tiered architectures grow more and more complex.
Bottlenecks and crashes can occur anywhere. Before your system goes live, what can
you do to optimize performance and minimize future headaches?
Slowdowns and bottlenecks can be identified in advance by testing the site with
simulated user traffic. This process is known as load testing. Organizations
performing a load test for the first time are usually surprised to learn that their
infrastructure can handle only about 15% of expected traffic before performance
degrades dramatically.
After the load test, adjustments ranging from minor tweaks to major
reconfigurations can vastly improve system performance. The load test can then be
repeated to find further problems or to retest the system over time. Because it improves
customer satisfaction and avoids unnecessary upgrades, the load testing cycle is a
crucial step in the development of any Web application.
After site developers have performed “sanity testing” to check basic functionality, there
are several methodologies for testing application performance under load.
A component testing objective could be to tune the database server to support the
maximum load possible using the current hardware.
The most fundamental testing form is known simply as “load testing”. Load testing is
defined as a short-term test of performance under real-world conditions. By
understanding average response time, site architects can confirm that the goals of the
design have been achieved.
For stress testing, the first objective could be to determine stress points. An
example would be to determine the maximum number of transactions, per second, that
the application can support. The second objective could be to find when the system
approaches maximum capacity. An example would be to determine at what capacity (80,
90, 100 or 100++) the non-critical services (e.g. display of flights availability graphs)
will be shut down, in the order of least to most important.
Figure 1-2 Load testing occurs throughout the product life cycle
The longer you wait to begin performance testing, the more costly the problem may
become. From a strictly financial point of view, performance testing should begin as
early as possible during the development cycle.
The limitations of manual testing make it difficult to achieve meaningful load test
results.
• How can I repeat the test after identifying and fixing problems?
LoadRunner provides you with tools that address the issues associated with manual
testing.
LoadRunner eliminates the need for hundreds of testers and massive resources. Instead,
“virtual users” execute test steps which have been recorded so they can be repeated.
These test steps are saved as scripts and are organized as “scenarios”, eliminating the
need to coordinate testing manually.
• LoadRunner Methodology
The LoadRunner Launch Screen provides access to all the LoadRunner components.
Accurate scripts form the foundation of an effective load test. Once planning is
completed the next step is to move to scripting. Scripting is done in VuGen. You can
learn more on how create, edit and enhance scripts in “VuGen Scripting for Web”
course.
What is a Vuser?
Vusers emulate the actions of human users working with your application. While a
workstation accommodates only a single human user, many Vusers can run
concurrently on a single workstation.
Supported Protocols
Each type of Vuser is designed to handle different aspects of the system architecture.
Any combination of different types of Vusers can be used in a scenario to create a
comprehensive application test.
What is a Scenario?
Scenario
A scenario is a file that defines the scripts to execute, the number of Vusers to run,
the goals of the test, the computer that will host the Vusers, and the conditions
under which the load test runs.
You use the LoadRunner Controller to manage and maintain your scenarios.
Using the Controller, you control all the Vusers in a scenario from a single workstation.
• Vuser scripts include functions that measure and record system performance during
load-testing sessions.
All system components should be monitored in order to achieve effective Root Cause
Analysis. For instance, if you have two Web servers, monitor both of them. If you have
three database servers, then monitor all three. Monitoring all the system components
will help you to isolate performance problems in any part of your system environment.
Before proceeding further, let’s understand how the LoadRunner components work.
• Controller – Allows you to design Scenarios, run and stop the load test. Scenario
files have the .lrs extension.
• Load Generator – When a scenario is running, the results are, by default, stored
locally on each load generator machine. After the scenario has stopped running, the
performance data from each load generator machine is sent to the results file that
you have specified.
• Analysis – Processes the gathered scenario results and generates graphs and reports.
When you work with the Analysis tool, you work within a session that contains at
least one set of scenario results contained in a file ending with the .lrr extension.
After the results are processed by the Analysis tool, the file is saved with the .lra
extension.
Based on the results of the five phases of load testing, the application and related
hardware are typically adjusted and improved to boost performance. The same tests can
then be executed again to measure the application’s improvement in performance.
• Create Vusers — Use the Virtual User Generator (VuGen) to automate user
actions of the selected business processes that you will test.
• Run Scenarios & Analyze Results — Run the load test and compile the results for
analysis using LoadRunner’s Controller. Use the analysis tools to organize and
display the results.
• Tune the System — Analysis of results should reveal areas of the system that
require adjustment. Once the adjustments are made, repeat the load test to
confirm that system adjustments had the desired effect.
The LoadRunner Expert’s tasks and responsibilities extend to five phases of the load
testing process. Remember that successful load testing is a team effort, and you need to
rely on each of your teammates’ expertise to succeed.
B
t
I
S
P
S
From the Windows Start menu select START → PROGRAMS → MERCURY TOURS →
MERCURY TOURS.
Note: Before you access the training application, invoke the Apache server by selecting
START PROGAMS → START SERVER.
In order to facilitate learning, the lesson order has been revised. In real life, you schedule
a scenario before it is executed.
LoadRunner Resources
Books Online
Student Materials
http://support.mercury.com
• Self-help Features
– Customer Knowledgebase
• Online Documentation
Summary
• LoadRunner enables you to automate application load testing.
• The load testing process consists of planning your load test, creating Vuser scripts,
creating your scenario, executing your scenario, and analyzing your results.
Summary 1-27
Introduction
_______________________________________________________________
_______________________________________________________________
Objectives
After completing this chapter, you will be able to:
2-1
Planning an Effective Load Test
• Some examples of conceptual goals and their relative priority might include the
following:
In the initial stages, jotting down unmeasurable goals will allow later filtering in order to
arrive at more focused goals, as well as to cover all objectives for load testing.
– Document user actions and valid input data for each business process.
The first task is to understand the application to be load tested. This may involve:
Gathering system usage data will help you determine business processes you need to
record, the expected response times, and the locations from which to monitor.
Just clicking a button is not a business process. It is only a step. A real business process
consists of taking an actual action such as finding information, making a purchase, or
changing an order.
The individual tasks and functions performed by the users in the application are often
called business processes.
Every mission-critical business process should be recorded and tested under load.
If you are unsure which processes are mission-critical, consult application experts or
your management team.
Heavy Throughput
Business processes that may not be mission-critical but are very popular.
For instance, an internal search engine may be an important and frequently used tool,
even though it is not the primary reason for a user to visit the site.
The "heavily used" category also includes business processes associated with periodic or
sporadic traffic. For instance, a home page may receive heavy traffic immediately after a
marketing promotion. For Client / Server systems, login will receive heavy throughput.
Any business process that relies on dynamic content is more likely to fail during periods
of heavy load than one based on static content.
Business
Dynamic Mission
Process Typical Day Peak Day Record
Content Critical
Name
Classroom Activity
Which business processes need to be recorded?
1. Choose a Web site, such as a ticket reservations site, E-commerce site, or one of
your production Web sites.
Measuring Steps
• LoadRunner allows us to define any number of elapsed time measurements for one
or more steps.
For example, you can validate a login function goal of 8-12 seconds by measuring the
elapsed time between the pressing of the "Sign-In" button and the appearance of the
results screen.
Once they are defined, the elapsed time will be recorded for every virtual user that
executes the script.
– Transactions measure only the time spent on the servers, not the time spent on
the client.
But what should be considered good performance? How much delay is acceptable? The
answer should be established for the most important steps of each business process.
• Preferred response time is the time the business process takes to complete under
ideal conditions.
• Preferred response time range is the time you want the business process to
complete, having taken slowdown factors into consideration.
Measurement criteria set by Preferred time allow us to keep a meaningful watch on the
application’s performance.
Figure 2-10 Logging in requires input (passwords) and steps (button push)
A business process is really just a series of steps. Some of these steps require the user to
input data. For instance, logging in to a Flight application usually requires two input
steps and a button push. Additionally, the input data must be recognized as valid for the
process is to succeed.
• Allows you to determine the navigation paths for the business processes
• Allows you to determine which user actions will utilize multiple data values
Document each step of each business process you selected for recording and
testing. An accurate documentation of these steps is important for recreating the test
cases and for identifying data sources, Transactions, and response times.
• Allow you to emulate multiple real users by varying sets of input data
• Master Data
• User-Generated Data
• External Data
LoadRunner Think Time is a measurement of the time that a real user takes to pause
between the execution of steps.
Users interact with an application according to their experience level and objectives.
• New users and those involved in certain kinds of business processes may proceed
very slowly.
By estimating these navigation times, virtual users can be made to emulate their real-
world counterparts more accurately during a load test.
• Navigation Times
What is a Concurrency?
Concurrency
• Application Level
• Transaction Level
Application Concurrency
A Task Distribution Diagram formats the business process and its volume across a time
line.
In the example above, the peak time is between 10am and 12pm on a typical day.
Formatting a TDD allows you to isolate usage peaks. In this example, the peak time is
outlined by the target time box. During this hour, the system experiences the heaviest
usage.
This is an important step in creating an effective load test. Testing your system under
peak load successfully ensures that the system can handle the load at other, less busy
times.
Testing your system under peak time will establish its baseline results. You should
increase the load in subsequent tests to test the scalability of your system.
Now that you know what your application can do, you can collect application usage, i.e.,
how users load your application at a given time. This will allow you to isolate the peak
time. The load that your system experiences is dynamic depending on the time of the
day.
For instance, e-commerce Web sites may experience heavy load during the lunch hour.
Conversely, an intranet application typically experiences heaviest load toward the end of
business hours. Consider, however, that usage can vary widely from one day to the next.
For example, a typical day will differ greatly compared to the days during the holiday
season. Due to this change in peak times, you should establish multiple baseline results
for system usage.
Note: Collect application usage for a typical day and also during heavy usage times like
holidays or promotions.
Transactional Concurrency
How many transactions will need to be run per minute if a load test has to be run for two
hours with 5000 users, assuming an average length of five minutes?
User Profile
Profiling Users:
Users may vary enormously in terms of familiarity with the application, technical
knowledge, and objectives for using the application. Some users might be creating new
accounts; others might be searching an archive for old material. Think of user types as
simplified stereotypes defined by business processes. To emulate the real-world load
created by different types of users, the proportion of each type of user must be
determined.
Traffic at the Flight Reservation can be represented by three groups. "New users"
register and then browse the general content. "Potential travelers" typically browse
destinations. "Ticket purchasers" browse flights and then purchase tickets. An individual
starts out as a "New user." Then he/she may progress to one or more other categories,
such as "Ticket purchaser" or “Potential traveler." However, our interest is not in
tracking individual users. Instead, we want to understand the cross-section of all users
that use the application on a typical day. Once we have defined these groups by their
respective business processes, we can estimate what percentage of total users belong to
each group.
Peak Load
Business processes with the highest levels of load will be the most important to load test.
In this example the peak load for the Search BP is 5000 simultaneous users for the
period of 10:00 to 12:00.
For the purposes of this example you can define peak load as follows:
Peak Load
The number of users performing the business process during the busiest hours of the
busiest day.
Customer Location
• Do known or estimated WAN / Internet traffic conditions affect whether goals can
be met?
– Latency
– Packet loss
• Will remote customers be connecting over long distances via WAN and/or the
Internet?
• Will requests transit many hops over the network via servers over which we have no
control?
• How can a more accurate projection of connect times under real conditions be
projected for customers connecting from very remote locations that require a long
transit via the Internet?
• How will such network conditions as packet loss or latency be taken into
consideration when measurements are made?
Now that we have gathered all necessary information for load testing, we can arrive at a
more focused, measurable goal. That will allow us to analyze the load test results and
define the success criteria for the application’s performance. Be sure to quantify each
conceptual goals.
For example, we can set a goal for ‘search’ of 8 seconds for average load and of no more
than 12 seconds during the peak hours. Remember we collected this information earlier
under ‘gather system usage information’.
For the second stated goal, 200 users should be able to ‘update’ records simultaneously
during peak time. State clearly that you are determining whether 200 users are
successful in updating the record at the same time during peak time.
Load testing is about finding bottlenecks. This requires a detailed understanding of the
application under test.
• System Administrators
• Backend experts
• Application experts
• Database Administrators
• System Checklists
For example, if the Search process performs poorly under load as compared to the Home
Page process, identifying the bottleneck may just be a matter of knowing which
components each processes uses. Having this information during analysis will help us to
more easily isolate the bottlenecks.
• Does the system have statistical information that will help in troubleshooting
performance issues?
• Allows data to be written, read, and destroyed without affecting production users.
• Allows test systems to be rebooted during test runs without affecting production
users.
• Needs business processes that are functioning correctly before running the load test
Note: Running an anti-virus while testing may prevent your load test from running
properly.
Benchmarking Run
To validate that there is enough test hardware available in the test environment,
benchmark the BPs against the testing hardware.
• Take a business process and execute a small number of users against the
application.
Summary
• Planning should be done before you start recording.
• Proper planning increases test coverage and reduces test development time.
• Understanding testing objectives helps build effective and measurable load tests.
• Document all relevant test information before building your load tests.
Summary 2-39
Planning an Effective Load Test
a) From the Windows Start menu, select START SERVER from the Mercury Tours
program group.
b) Verify that the START SERVER window displays the following line:
Apache/1.3.17 <Win32> ApacheJServ/1.1.2 running...
Note: ALWAYS use the Stop Server process (either from the Desktop icon or from the
Start menu Programs > Mercury Tours) to stop the Apache Web server. If you shut the
server down some other way, unexpected results may occur.
b) In the URL space, type the URL of the training Web site:
http://localhost/servlets/com.mercurytours.servlet.WelcomeServlet
c) Press ENTER.
The Mercury Tours Web site should come up. Mercury Tours will be the
application under test. Familiarize yourself with Mercury Tours by performing the
steps listed under “MERCURY TOURS User Steps Table” above.
Exercise B: Planning
Before you begin load testing, answer the following questions to test your understanding
of the Planning lesson.
Identify all the sub-business processes from the “MERCURY TOURS User Steps
Table” that fit the business process definition discussed in this chapter.
__________________________________________________________________
______
List the user steps that require input data for the identified business processes.
What are the criteria for determining which business processes should be recorded?
__________________________________________________________________
________________________________________________________________
Analyze the chart below. Based on this chart, which business processes will you
choose to record?
__________________________________________________________________
View flight
booking 20/hr 30/hr Moderate High
Examine the TDD (Task Distribution Diagram) below and determine the peak
time.
__________________________________________________________________
Business
Processes
Create new account Night 40 30 Day50 100 50 50 25 120 Night
Administrative
Processes
Invoice 50 50 50 50
processing
System backup 1 1
12 2 4 6 8 10 12 2 4 6 8 10 12
am pm am
FLIGHT RESERVATION (typical work day)
Review Questions
Test your understanding of this lesson by answering the following questions:
__________________________________________________________________
__________________________________________________________________
__________________________________________________________________
__________________________________________________________________
__________________________________________________________________
__________________________________________________________________
Note: The section which follow provide sample planning forms. The forms are not
intended as exercises.
Primary Goal
Secondary Goals
Additional Goals
3. For each user profile, indicate the associated business processes and percentage of
total users. The percentages should tally to 100%.
User Profiles Description Total Users (%) Business Processes Average Navigation
Times
Total 100%
Table 2-1.
5. For each business process, estimate the average and peak number of simultaneous
users. In other words, how many users are performing each process in a typical day
and in the heaviest periods?
6. For each business process, indicate which are mission critical, which experience
heavy throughput, and which feature dynamic content.
7. Based on these criteria and the lesson, determine which processes to record.
Business Process Average Number Peak Number Mission Heavy Dynamic Record
of Simultaneous of Critical? Through- Content? This
Users Simultaneous put? Process?
Users
V V V V
V V V V
V V V V
V V V V
V V V V
V V V V
Table 2-2.
8. For each selected business process, document user steps and determine whether the
step requires input data. If so, indicate the data source.
Preferred -
V V
Unacceptable -
Preferred -
V V
Unacceptable -
Preferred -
V V
Unacceptable -
Preferred -
V V
Unacceptable -
Preferred -
V V
Unacceptable -
Preferred -
V V
Unacceptable -
Table 2-3.
9. Fill out as much of the system configuration table for each component as possible.
Web Servers
Quantity Server Software Hardware Specs OS
Application Servers
Quantity Server Software Hardware Specs OS
Database Servers
Quantity Server Software Hardware Specs OS
10. For each business process, indicate the servers that are exercised by the process.
V V V
V V V
V V V
V V V
V V V
V V V
12. Return to the table in Section B Step 7 and determine where — based on the
quantitative goals — LoadRunner transactions should be added.
13. In the same table, indicate preferred and unacceptable response times for each
LoadRunner transaction added.
Table 2-4.
Installation
Objectives
After completing this chapter, you will be able to:
3-1
Installation
Where Do I Start?
• Check your LoadRunner package for the software CD and a set of documentation
– online at http://support.mercuryinteractive.com
Before proceeding further, let’s understand how the LoadRunner components work.
• VuGen (Virtual User Generator) – Allows you to create scripts. These scripts
emulate human users on playback.
• Controller – Allows you to design Scenarios, run and stop the load test. Scenario
files have the .lrs extension.
• Load Generator – When a scenario is running, the results are stored locally on each
load generator machine by default. After the scenario stops running, the
performance data from each load generator machine is sent to the results file that
you have specified.
• Analysis – Processes the gathered scenario results and generates graphs and reports.
When you work with the Analysis tool, you work within a session that contains at
least one set of scenario results contained in a file ending .lrr. After the results
are processed by the Analysis tool, the file is saved as .lra.
Installing VuGen
• Verify that the PC hosting VuGen can open the application to confirm proper setup
• LoadRunner license keys are installed on the Controller and locked to the computer
by a Host ID.
• The license key controls the number and type of virtual users and the type of
monitors that can be used in the Controller.
• Load Generators are installed from wherever users access the application under test.
• Load Generators need connectivity to both the Controller and the AUT (application
under test).
Note: You must have administrative privileges to run LoadRunner on your machine.
Automatic login (selected during the LoadRunner install) determines whether the
LoadRunner Agent runs as a process or as a service.
If you have a significant customer base at different locations, consider installing Load
Generators at these locations.
This emulates human users accessing your application from these locations.
WAN Emulation
Wan Emulation
• Should be installed on all load generator machines (requires a separate install and
license).
• Find out if the application is able to handle the WAN/Internet packet loss and
latency behavior.
• Discover how certain elements affect the performance of your site when remote
users connect.
– Network latency
– Packet loss
– Packet duplication
– Packet fragmentation
WAN Emulation is available only for load generators running on a Windows platform.
Access it from the Load Generator Information dialog box and select the WAN
Emulation tab.
You can change WAN emulation settings only while a load generator is in the Down
status.
The load generator status changes to Down, and you can change the settings. The load
generator cannot be a localhost; it must be a remote machine.
Installing Analysis
– Keep in mind the number of test runs you plan to make (the more test runs the
more disk space required).
– Think about how long the test data needs to be stored (the amount of stored and
new data needs to be taken into account).
The hardware should be powerful and fast enough to emulate the required
number of virtual users.
• When selecting the machine for Analysis, keep in mind how many Load Generator
machines are running.
http://www.mercury.com/us/products/performance-
center/loadrunner/requirements.html
– DNS name
– IP address
4. Select the appropriate operating system and a valid path for temporary storage.
Summary
• Three main software components of LoadRunner are:
– VuGen
– Controller
– Analysis
3-18 Summary
Installation
Exercise: Installation
The topics just covered give an overview of LoadRunner installation. In this exercise
you will add and connect load generators, then answer a series of questions dealing with
LoadRunner components and the installation process.
Exercise A: Troubleshooting
Windows NT
a) Right-click the Network desktop icon and select “Properties” from the pop-up
menu. The machine name appears in the Properties dialog.
Windows 2000
b) Under the LOAD TESTING tab, click the RUN LOAD TESTS link. This will open
the LoadRunner Controller.
a) Click OK on the NEW SCENARIO dialog. The Controller DESIGN tab opens,
displaying the SCENARIO SCHEDULE and SCENARIO GROUPS panes.
b) By default, this will have the localhost added as your generator. Change the name to
your machine’s network name.
b) In the NAME box, type the partner’s machine name you wrote down in the first step of
this exercise.
c) In the PLATFORM list box, select WINDOWS and then click OK.
a) Select the machines that you just added one at a time and click the CONNECT button.
b) Make sure that the load generator status in the STATUS changes to “Ready” for the
load generators.
b) Click on the GENERATORS button. This opens the Load Generators dialog.
__________________________________________________________________
______
Explain the message that you received for the second generator.
__________________________________________________________________
______
b) Select the second load generator machine and click the CONNECT button. The
load generator status in the STATUS changes to “Ready”.
Exercise B: Installation
One task of a LoadRunner expert is to educate the system and database
administrators about the location where the LR components are to be installed, the
quantity and type of hardware needed, and the data flow between LR components.
In this exercise, the customer base is highly concentrated in San Francisco and New
York. The application to be tested is located in San Francisco.
Components that the company has purchased and needs to install are:
– VuGen
– LoadRunner Controller
– LoadRunner Analysis
– Load Generators
a) New York
b) San Francisco
d) Kansas City
3. What things do you need to keep in mind when deciding on the hardware
requirement for a LoadRunner installation?
__________________________________________________________________
_______________________________________________________
Review Questions
Test your understanding of this lesson by answering the following questions:
________________________________________
___________________________________________
Introduction to Scenarios
Objectives
After completing this chapter, you will be able to:
4-1
Introduction to Scenarios
What is a Scenario
• How many virtual users will execute each script, and how suddenly or gradually
should they begin?
• The Scenario Outline incorporates Quantitative goals (Controller goals) into the
scenario design
– number of Vusers
For example, if the goal is "2000 concurrent users able to buy tickets at the same time,"
the objective could be satisfied with a 'Buy Ticket' script in a 'number of Vusers'
scenario.
You use the commands in the File menu to create, open, save, and close scenario files.
To create a new scenario, choose FILE > NEW, or click the NEW button on the
Controller toolbar. The NEW SCENARIO window will open. From here select either
Manual Scenario or Goal-Oriented Scenario.
Note: The NEW command creates a completely new scenario. Note that this command
clears all the information displayed in the Controller windows.
4. Click OK. The scenario opens in the Controller with the selected scripts included.
Note: The Remove button will eliminate the script from the scenario but not from the
file system.
Vuser Groups
• Each group can be assigned a different script to emulate different business process
• Create Vuser groups from the Scenario Groups pane of the Controller
1. Click the ADD GROUP button to the right of the Scenario Groups pane. The ADD
GROUP dialog box opens.
2. In the GROUP NAME box, enter a name for the Vuser group.
3. From the VUSER QUANTITY box, select the number of Vusers that you want to
create in the group.
4. Select a load generator from the LOAD GENERATOR NAME list. The Load
Generator list contains all load generators that you previously added to the
scenario.
5. Click OK to close the ADD GROUP dialog box. The new group’s properties appear
in the SCENARIO GROUPS pane.
1. Modifying Vuser group settingsSelect the Vuser group whose settings you want
to change and click the DETAILS button.
This will open the Group Information dialog displaying all the information about
that group. You can change the Group name, load generator name, Vuser
quantity, and Run-time Settings of the script.
2. Once you have modified the necessary settings, click OK. This will update the
changes for that Vuser group.
Manual Scenario
• Manual control over how many Vusers run and at what times.
Goal-Oriented Scenario
• Your user profile and the customer location will give you the answer for selecting
locations for the load generators
The Load Generators dialog box opens. The Name of the load generator, its
Status, Platform, and Details are displayed.
2. Click the ADD button to add a new generator. The Add Load Generator dialog box
opens.
2. In the PLATFORM box, select the type of platform on which the load generator is
running.
3. Click OK
This is an optional step. When you issue the Run command for scenario execution, the
assigned load generators will automatically connect. You can use this step to test if load
generators are connecting correctly.
Click CONNECT to change the Status of the load generator from “Down” to “Ready”.
It is a good practice to always connect the load generators once you add them.
2. Click the DETAILS button. The LOAD GENERATOR INFORMATION dialog box opens.
Do not confuse this Details button with the one available on the Scenario Groups
screen. This one allows you to modify Vuser group settings.
The Load Generator Information dialog box allows you to configure settings for
individual load generators.
To learn more about the options for, configuring load generators, refer to the
LoadRunner books online (Controller User’s Guide under Designing a
Scenario topic).
Before you begin to assign scripts / user profiles to load generators, it is critical to go
back to the planning chart and ask the above mentioned questions. Each question will
have a preceding concern to answer. For example, you may find that a concentration of
new users is found in the vicinity of San Francisco. So we will assign the script that
performs the business process or processes that a new user performs to the load
generator located in San Francisco.
Going back to the planning document and determining which ‘User Profiles’ best
represent the load generator’s location will allow you to assign the right scripts to the
load generators.
Determine the user profile that will best represent the cross-section of business process
activity for the load generator location. Based on the findings, assign the selected “User
Profile” to that location.
• Simple Scenarios
– Assign 100% of Vusers to the script to profile a group of users performing the
same action.
Summary
• Create Scenarios around quantitative goals.
Summary 4-21
Introduction to Scenarios
Quantitative Goal: Attain 1,000 concurrent users for the Search transaction during
peak time.
2. Choose the appropriate scenario type, given the following Scenario outline:
Scenario Outline: Script should define ‘search’ transaction and load test should
achieve 1,000 concurrent users at peak time.
a) Manual Scenario
b) Goal-Oriented Scenario
c) Both
_________________________________________________________________
3. A client has significant customer base in Seattle, Paris, and New York. There are
three load generators installed at each location. Gathered information shows:
– Register
– 2. Update
– 3. Buy
4. Based on the limited information available, how will you approach assigning scripts
to the load generators?
________________________________________________________________
__________________________________________________________________
5. Will you assign particular scripts to some load generators, or will you assign all the
scripts to all the load generators?
________________________________________________________________
__________________________________________________________________
Make sure the Apache Web Server is running. The START SERVER icon should
appear on the Windows Task Bar. If you do not see it, check Task Manager’s
Applications tab. START SERVER should appear there also.
a) From the Windows Start menu, Mercury Tours select “Start Server”.
b) Verify that the Start Server window displays the following line:
Apache/1.3.17 <Win32> ApacheJServ/1.1.2 running...
Note: ALWAYS use Stop Server (either from the Desktop icon or the Start menu
PROGRAMS → MERCURY TOURS) to stop the Apache Web server. Shutting it down by
other methods may result in unexpected results.
1. Invoke the Controller. If the LoadRunner Controller is already open, then move to
step two.
a) From the Windows Start menu, select LOADRUNNER from the Mercury
LoadRunner program group. This will launch the LoadRunner main screen /
launcher.
b) Under the LOAD TESTING tab, click the RUN LOAD TESTS link. This will open
the LoadRunner Controller.
a) Select BOOKFLIGHT from the Available Scripts list and click the ADD
button. .
c) Click OK. The Controller DESIGN tab opens, displaying the Scenario Schedule
and Scenario Groups panes.
b) In the Group Information dialog box, overwrite the text in the Group Name box
with scenario_groupa.
2. Add 10 Vusers.
a) Click the RESULTS → AUTO LOAD ANALYSIS toolbar button to disable the
analysis from opening after a test run.
a) Select RESULTS → RESULTS SETTINGS. The Set Results Directory dialog box
opens.
When the Scenario runs, the tab changes automatically from DESIGN to RUN.
What option will you use to configure settings on individual load generators?
__________________________________________________________
1. Configure the load generator to initialize 5 Vusers for the both the groups.
c) Select the load generator that you added in your scenario, default is localhost.
d) Click the DETAILS button, this will invoke the LOAD GENERATOR
INFORMATION dialog.
When the Scenario runs, the tab changes from Design to Run automatically.
a) Observe the Scenario Groups pane to see stages the Vusers go through. More
on the Vuser stages will be discussed in the Scenario Execution lesson.
Explain what you observed when the scenario ran without initialization as
compared to with initialization options enabled?
__________________________________________________________________
_________________________________________________________
Review Questions
Test your understanding of this lesson by answering the following questions:
_____________________________________________
What factors should determine which scripts are assigned to load generators?
____________________________________
Objectives
After completing this chapter, you will be able to:
5-1
Using Run-time Settings
Before you run a scenario, you can configure both the load generator and
Vuser behaviors for the scenario. Although the default settings correspond
to most environments, LoadRunner allows you to modify the settings in
order to customize the scenario behavior. The settings apply to all future
scenario runs and generally only need to be set once.
a) The run time settings button of the Controller for settings associated with the
Vuser groups
• Different Vuser groups using the same script may use different Run-time settings.
• Script Run-time settings affect Vuser behavior and resource usage “footprints.”
Note: When you modify a script's Run-time settings in the Controller, the new settings are saved
with the Controller scenario. If you open the script in VuGen and modify the Run-time settings,
select the group where the script is running then click Details to open the Group Information
dialog box. Click the Refresh button to see the new settings.
Defines settings that affect script execution like run-logic, pacing, logging and think
time.
• Are used for debugging purposes and to solve playback problems in VuGen.
• Defines how the script behaves when running a load test in the Controller.
The Run-time options change depending on the script environment and protocols. For
example, in Web you will see: Browser, Network, and Internet Protocol nodes.
Run Logic
Run Logic
• Is used to model more closely the way real users interact with the application.
• Replicates a real user performing steps in a business process more than once.
• Allows setting of the iteration count (how many times a Vuser repeats a task).
Note: Iterations are only performed in Actions; the Init and End sections are run a single
time.
A real user will log in only once but is sure to perform booking tickets more than once.
The above example indicates that in order to achieve the load testing goal, you will need
to iterate steps 5, 6, and 7 five hundred times - assuming that we have only one Vuser
running the script.
In a real life scenario, this will not be true. If there are ten Vusers running the script, the
number of iteration will be set to 50. If you have 50 Vusers running the script, then the
number of iterations will be 10. This naturally assumes that steps 5,6, and 7 are recorded
inside the “Action” section of the script.
Pacing
Pacing
Pacing 5-9
Using Run-time Settings
Log Settings
In the Controller, the default logging setting is to send messages only when there is an
error.
• Error messages.
• Parameter substitution.
• Transaction status.
• Verification status.
Think Time
LoadRunner Think Time is a measurement of the time that a real user takes to pause
between the execution of steps in a business process.
Note: In VuGen, when think time is created, a statement is added to the script. The
statement indicates the amount of time to wait before executing the next step.
• Introduces the right amount of delay within a business process to emulate user
behavior accurately.
• The best practice is to set Think Time while creating the script (VuGen).
• May cause the application under test (AUT) to fail with very few Vusers running.
• Script
Assuming that the average think time for advanced users is 5 seconds and first time
users is 10 seconds, how can you set Think Time to emulate first-time users as required
by the load testing goal?
Additional Attributes
Additional attributes allows you to pass parameters to prepared scripts, enabling the
testing and monitoring of servers with different client parameters.
Miscellaneous Settings
t
Multithreading
Automatic Transactions
Browser Emulation
• Emulates different browsers to test user experience on response times and content
availability.
Proxy
• Configures Vusers to obtain proxy settings either from the default browser or to
bypass proxy and make direct connections to the Internet.
Preferences
Allows specifying Vuser quota, stopping behavior, and random sequence seed for
all Vusers and groups for the current scenario.
• Vuser Quotas
• Stopping Vusers
– Each seed value represents one sequence of random values used for test
execution
– The setting applies to parameterized Vuser scripts and randomized think times
Summary
• Explained the differences between Script and Vuser Run-time Settings.
Summary 5-21
Using Run-time Settings
1. Invoke the Controller. If the LoadRunner Controller is already open, then move to
step two.
b) Under the LOAD TESTING tab, click the RUN LOAD TESTS link. This will open
the LoadRunner Controller.
If the New Scenario dialog did not appear automatically after you invoked the
Controller or if the Controller is open. Do this:
a) Select BOOKFLIGHT from the AVAILABLE SCRIPTS list and click the ADD
button. .
c) b) Click OK. The CONTROLLER DESIGN tab opens, displaying the SCENARIO
SCHEDULE and SCENARIO GROUPS panes.
b) In the GROUP INFORMATION dialog box overwrite the text in the GROUP NAME
box with rt_settingsa.
Verify that the Run-time Settings are the same as those in the table below. Change
any setting that does not agree with the table. If there is no row in the table for a
setting, leave it as is.
What option will you use in the Run-time Settings to set iterations?
________________________________________________
NODE SETTINGS
What option will you use in the Run-time Settings to start iterations randomly at
every 30 seconds?
_________________________________________________________
NODE SETTINGS
General: Pacing Check At random intervals, every and enter “30” to and “45” sec.
General: Log Select Enable logging.
Select Extended log.
General: Think Select Replay think time.
Time Check Use random percentage of recorded think time: and enter
“50” in Min and “150” in Max box.
Deselect Limit think time...
a) Click OK to save any changes and close the Run-Time Settings dialog
a) When the Scenario runs, the tab automatically changes from Design to Run.
__________________________________________________
Verify that the Run-time Settings are the same as those in the table below. Change
any setting that does not agree with the table. If there is no row in the table for a
setting, leave it as is.
NODE SETTINGS
General: Pacing Check At random intervals, every and enter “30” to and “45” sec.
General: Log Select Enable logging.
Select Extended log.
General: Think Select Ignore think time.
Time
a) When the Scenario runs, the tab automatically changes from Design to Run.
How did the scenario behave, when think time were ignored?
__________________________________________________________
Review Questions
1. Where will you set the ‘Vuser Quotas’?
________________________________________________________________
__________________________________________________________________
_____________________________________________________________
Scenario Execution
Objectives
After completing this chapter, you will be able to:
6-1
Scenario Execution
• After execution, results from all load generators are transferred to the Controller’s
results directory for analysis.
Note: Selecting Run causes the Controller to connect to the Load Generators
automatically. However, you might want to test the connections before trying to run a
scenario.
Rendezvous
• A Rendezvous is a step added during script creation and defined in VuGen.
– Percentage of all running Vusers (50% of users arrive between 8AM and 9AM)
The answer is that when a load test uses a Rendezvous, the system under test is
experiencing high stress as all the Vusers are trying to do task “A” at the same time. This
renders the transaction time meaningless.
Rendezvous 6-5
Scenario Execution
• Add performance monitors in the Run tab (more information on this is presented in
the performance monitors lesson).
• Specify a location to save the scenario results and decide on a name for the results.
Select RESULTS → RESULTS SETTINGS to specify a name and location for saving the
scenario results.
Running the scenario is straightforward. Execution begins when the Controller's START
SCENARIO button is pressed. But as the virtual users execute their scripts, a whole team
is needed to maximize the usefulness of the test.
• One or more network administrators should monitor the network as load increases.
By using the third-party performance monitoring tools already in place, these
administrators will complement the LoadRunner results and enhance the efficiency
of the root cause analysis process.
• Validates that the BP functions for concurrent usage with the data being used in the
test.
The debug run is also a concurrency test. At this point, testing is done to check whether
Vusers can be run concurrently from the Controller.
If your scenario has more than one script, include all those scripts in the Debug run.
The isolate top time transactions run helps us to understand the application’s
responsiveness and allows us to focus on major problem areas.
5. Remove subsequent bottlenecks until the system performs well under full load.
6. The results of the first full load test (100%) are used as baseline results to be
compared subsequently with other full load test run results.
After meeting your load testing goals, the next step is to understand the final limits of
the system. This allows us to do capacity planning for future growth and gives us a
factor of safety with our application. Scalability test is known as Overload/Overdrive
test.
• Determine the limit of load that can be handled before more resources are required.
Best Practices
• Use results of the first few full load tests (100%) as baselines. Work from them to
measure performance improvement
• If performance does not agree with your goals, use LoadRunner performance
monitors and subject matter experts to isolate bottlenecks. Once a bottleneck is
identified, get experts (backend, application etc.) to fix the problem.
• Understand that testing occurs in cycles and set expectations accordingly. Allow
time between tests for subject matter experts to make changes recommended by test
results.
Figure 6-7
The Vuser status window gives you options to control the Vusers and scenario
execution.
• VUSERS button opens Vusers window and shows the status of the Vusers
• Distributes the Vusers in the group to their designated load generators where they
achieve the Ready status needed to start executing their script(s).
• Initializing Vuser groups ensures that the Vusers begin executing the scenario at
approximately the same time.
Figure 6-9
The Status field of each group displays the current state of each Vuser in that group.
• Pending: When a Run or Start Scenario is invoked, then the scripts are transferred
to the load generator machines, or wait until a load generator becomes available.
• Ready: The Vusers have all finished preparing the load generators and the tasks in
the vuser_init section of the script are now ready for the run. If you have checked
initialization, Vusers that are currently ready will wait for all Vusers to reach Ready
status.
• Running: All the Vusers are running the script on the assigned load generator
machines.
• Rendezvous: (If a rendezvous is defined in the script). The Vusers have arrived at
the rendezvous and are waiting to be released by LoadRunner.
• Passed: If a few Vusers are selected to be run from a scenario group, when they
finish running the script and if they pass, the Vuser status will report a Passed
status.
• Failed: If a few Vusers are selected to be run from a scenario group, if they fail
during the scenario run, the Vuser status will report a Failed status.
• Error: An error occurred. Check the Vuser output window for a detailed
explanation.
• Gradual Exiting: The Vusers have completed running the iteration (as specified in
the scenario Run-time settings) and will exit based on Ramp Down options as
specified in the Scenario Builder for a manual scenario. For a goal based scenario,
they will exit based on the scenario settings defined.
• Exiting: The Vusers have finished running the script or have been stopped.
Vuser Window
Vuser Log
• If you disabled the logging feature in the ‘Run-Time Settings’ Log node, the Vuser
script log will be empty.
• If you selected the SEND MESSAGES ONLY WHEN AN ERROR OCCURS option in the
Log tab, the Vuser script log will contain output messages only if there were script
errors.
• Elapsed time
• Hits/Second
Note: Here is one of our first lines of defense. When the AUT starts to fail, it will likely
degrade in transaction time. You may also see failure and error messages.
NOTE THE DIFFERENCE: In the "Scenario Status" in the Run tab view, elapsed
time is calculated from the time the scenario is started. This means that the time is
measured from the time you click on "Start Scenario" or "Initialize/Run Vuser".
However, in the "Vuser" window, elapsed time is calculated from the time the Vuser
enters the 'running' state.
Scenario Errors
2. To view details of the log information by message, Vuser, script or load generator,
click the link in the respective column.
3. Alternatively, select the message and click the Details button. The Detailed
Message Text box opens in the Output window displaying the complete message
text.
• Indicates that the Web server is not responding or that connectivity has slowed
between the load generators and the Web servers.
One or two time-outs may be considered trivial, but a large number of time-outs must be
considered as a serious problem. Confirm with the administrator that the Web server is up
and communicating with the other tiers of the application. Rerun the scenario at a lower
level of load to determine the current performance threshold and help the backend
administrator isolate the problem.
HTTP 500
• Indicates either that individual business processes are failing under load, or that the
Web application itself has crashed.
Summary
• Specified results directory before running a scenario.
– Debugging Run
– Scalability test.
Summary 6-23
Scenario Execution
Scenario Number
Execution Process of Vusers
b) Verify that the Run-time Settings are the same as those in the table below.
c) Change any setting that does not agree with the table. If there is no row in the
table for a setting, leave it as is.
NODE SETTINGS
NODE SETTINGS
5. Run 2 Vusers.
a) Select 2 rows in the VUSERS window and click the RUN button .
b) Wait for the status of each Vuser to change to “Done.” If the Collating Results
dialog is open, close it.
6. If both Vusers finished the run without an error, reset the Vusers to “Down” status.
b) Verify that the Run-time Settings are the same as those in the table below.
c) Change any setting that does not agree with the table. If there is no row in the
table for a setting, leave it as is.
NODE SETTINGS
a) Select 5 rows in the VUSERS window and click the RUN button .
Wait for the status of each Vuser to change to “Done.”
a) Click the Show Vuser Log button in the Vusers window. The Vuser output
windows open.
Click here
a) a) Click the FIND TEXT button inside the VUSER OUTPUT window dialog
to open the FIND dialog.
b) Type the word “error” in the FIND WHAT box, then click the FIND button.
If the Vuser ran OK, “error” will not be found in the log.
a) Type “transaction” in the FIND WHAT box, then click the FIND button.
All transactions should show a Pass status.
a) Type “parameter” in the FIND WHAT box, then click the FIND button.
Parameter substitutions should show different data values for each iteration.
In the “Find Top Time Transactions” exercise you will be working with the Analysis
part of the LoadRunner tool. Use this part of the exercise to accustom yourself to the
Analysis tool. We will cover more on Analysis in Lesson 8.
a) Click the RESULTS → ANALYZE RESULTS toolbar button and wait for
the Analysis Summary to appear.
b) If that tab does not appear in your ANALYSIS window, click the ADD NEW
GRAPH toolbar button to open the OPEN A NEW GRAPH dialog.
d) Click the OPEN GRAPH button, then close the dialog after the graph appears.
Which transaction had the highest average response time? (HINT: Click a line in
the graph to highlight the corresponding row in the grid below.)
___________________________________________________
Why should you remove BookFlight_Transaction from the graph when looking for
top time transactions?
__________________________________________________________________
_____________________________________________
Does the graph show any spikes now? If yes, which transaction(s) caused the spikes?
___________________________________________________
Note: The graphs and questions in this section are intended to be suggestive, not
prescriptive. As you become more familiar with LoadRunner’s analysis tools and with
load testing, you may find other tools and questions useful as well.
Note: During this exercise, you should check the Windows Task Manager
occasionally to make sure that your machine does not run out of resources. If it does,
stop the scenario and scale down the number of Vusers that you run to a number that
does not consume all of the computer’s resources.
TIP LoadRunner can automatically create a results database and display the Analysis
window. If Auto Analysis is not enabled, you can select Results > Analyze Results
from the menu to perform those actions after a scenario has finished running.
d) Verify that the Run-time Settings are the same as those in the table below.
e) Change any setting that does not agree with the table. If there is no row in the
table for a setting, leave it as is.
NODE SETTINGS
Note: If you were conducting a real load test on your system, you should analyze the test
results at this point and report your findings to the system experts. They should then tune
the system to optimize it for 100% load.
__________________________________
Note: Make sure you specify the results file for the scenario runs in this exercise. You
will be performing analysis on these results in a future lab.
Review Questions
Test your understanding of this lesson by answering the following questions:
1. Why is it a good practice to run just a few Vusers the first time?
____________________________
2. Why do the transaction measurements not matter when testing multiple Vusers to
make sure they can run concurrently without errors?
________________________
Scheduling Scenarios
Objectives
After completing this chapter, you will be able to:
7-1
Scheduling Scenarios
This section addresses how you can schedule the execution of your scenario.
Scheduling Scenarios
• Enables the repetition of important usage patterns throughout load testing for the
defined duration of the load test.
Using the Schedule Builder, you control the execution of your scenario.
1. Select SCENARIO → SCHEDULE BUILDER or click the Edit Schedule button. The
Schedule Builder dialog box opens.
– Select the name of the schedule you want to use for the scenario.
– New: Opens the New Schedule dialog box, enabling you to enter the new
schedule name.
• Specifies either the number of minutes you want LoadRunner to wait from the time
a Run command is issued, or the specific time at which you want the scenario to
begin.
1. Select SCENARIO > START TIME. The SCENARIO START dialog box opens.
2. Specify how long to delay after the Run command is issued, or specify a particular
date and / or time.
Schedule by Scenario
Scheduling by Scenario
Schedule by Group
Figure 7-6
Scheduling by Group
• Allows you to delay the start time for Vuser groups and the scenario.
– the amount of time after the start of the scenario that the group must wait
before it starts running.
– the number of Vusers that will run within a specified period of time.
– the number of Vusers that will be stopped within a specified period of time.
Ramp Up
Ramp Up
• Best Practices
– Transaction response time goals are most quickly met with immediate load.
– When the application has reached a threshold, heavy ramping down will allow
you to detect any memory leak or check network latency or database integrity.
7-8 Ramp Up
Scheduling Scenarios
Ramp Down
Ramp Down
• Only applicable for scenarios where the Duration tab "Run for" option is selected.
• Can be used to detect memory leak and system recovery after heavy load.
• Best Practices
– When the application has reached a threshold, heavy ramping down will allow
you to detect any memory leak or check network latency or database integrity.
Scenario Duration
Figure 7-9
The Duration tab allows you to select how long your scenario runs.
Run for
Run indefinitely
• Runs the scenario indefinitely for testing the stability of the application (volume
testing).
• Use this option when you have unique values in your script. For example, the script
creates unique records for the application, and you want to create only 1000
records. Choose Run until completion to guarantee that only the specified number
of iterations are run.
Run for
• Run the ‘Actions’ part of the script for the specified duration. Use this option when
there are no unique values in the script.
Run indefinitely
• Runs the ‘Action’ part of the script indefinitely. You have to stop the scenario
manually. Use this option when you do not have any unique
values in the script and for stability testing.
If the Run for option is selected and the Initialize all Vusers before run is not checked,
then consider that some Vusers may take a longer time to initialize and may never reach
the Running state before the scenario ends.
Calculate the total time required for initializing all the Vusers. The Run for option
should be set to a higher number than the calculated time. This will ensure that all the
Vusers in the scenario will reach the Run status before the scenario ends.
Note: The duration setting under the Run for option overrides the Vuser iteration
settings. This means that if the duration is set to five minutes, the Vusers will continue to
run as many iterations as required in five minutes even if the run-time settings specify
only one iteration.
Initialization
Figure 7-10
Initialization prepares the Vusers and the load generator machines for a load test run.
During initialization, the vuser_init section of the script is executed. For some protocols,
this section includes information for initializing pointers or handles. However, most of
the protocols contain nothing in the vuser_init section except the business process steps
you have recorded.
– Initializing all Vusers before ramp-up reduces CPU consumption and get
realistic results. Web Vusers initially cause a huge impact as compared to SAP
Vusers, causing the memory utilization to be ten times greater.
– Initializing Vusers before ramp up ensures that all the Vusers are ready to start
running the scenario. If initialization is not checked before running the
scenario, some Vusers will take longer to reach the ready status while others
might be already running the scenario.
7-12 Initialization
Scheduling Scenarios
Figure 7-11
1. The Controller stops the Vusers according to the settings defined in the Scenario
Run-time Settings tab.
2. If you have set the option to stop Vusers running when the Stop button is clicked,
the Vusers will stop immediately.
3. If you instructed a Vuser to complete the iteration it is running before stopping, then
Vusers will continue to run even after the stop button has been pressed.
4. Once the current iteration is completed the Vusers will stop running.
In other words, if you have defined Vusers to complete the action they are running
before stopping, then Vusers will complete the run.
Summary
• Explained the elements of Scheduling a Scenario by Scenario and Group.
• Initialize Vusers before ramp up if appropriate for your load testing goal.
7-14 Summary
Scheduling Scenarios
1. An application on the west coast has a customer base concentrated in Asia working
from midnight to 2 a.m. During this time, a batch process is also run. How can the
overall system performance for this time period be tested at midnight without the
physical presence of a tester?
__________________________________________________________________
_______________________________________________
Utilize the LR Controller and schedule the scenario to achieve the objective in question
one. Try to do so without looking at the steps listed below. Use them only when you find
yourself unable to proceed without detailed instructions.
b) Under the Load Testing tab, click the RUN LOAD TESTS link. This will open
the LoadRunner Controller.
a) If the NEW SCENARIO dialog did not appear automatically after you invoked
the Controller, select FILE → NEW or click the CREATE A NEW SCENARIO
button to open it.
a) a) Select “BOOKFLIGHT” from the AVAILABLE SCRIPTS list and click the ADD
BUTTON.
c) Click OK. The CONTROLLER DESIGN tab opens, displaying the SCENARIO
SCHEDULE and SCENARIO GROUPS panes.
c) Select AT option and specify to start the scenario at midnight and the date.
e) Click the DURATION tab and select RUN FOR option. Set it to run for two
hours. This will run the scenario from 12 in the midnight to 2 am.
f) Once you are done scheduling the scenario, Click OK to close the SCENARIO
BUILDER window.
1. Create a new group named group2 and add 10 Vusers. Leave the pre-existing
group as is.
b) Select the SCENARIO START TIME button. This will open the SCENARIO START
window.
___________________________
___________________________
c) Select “START” option and specify 02 for minutes in the “AFTER THE
SCENARIO BEGINS” edit box.
b) Select “RUN FOR” option and specify 30 for minutes in the “(HH:MM:SS)”
edit box.
c) Select “START” option and specify 01 for minutes in the “AFTER THE
SCENARIO BEGINS” edit box.
8. Leave default settings in the ramp up, duration and ramp down tabs.
a) Do not change any other settings in the following tabs: Ramp Up, Duration,
and Ramp Down.
Scenario Groups pane will show you the different scheduling settings for the
groups.
a) Select RESULTS → RESULTS SETTINGS. The Set Results Directory dialog box
opens.
4. 4. Observe the Vusers’ statuses and then answer the questions below.
b) Watch the Scenario Groups pane to observe what statuses Vusers go through.
__________________________________
Did Vusers from both the groups get initialized before moving to the “Run” state?
__________________________________________________________________
__
How long did it take for the groups to start running the scenario after the
Start Scenario button was pressed?
_______________________________________
Based on your observation of the scenario run, explain the Vuser status behavior
between the two groups.
_______________________________________
Review Questions
Review Questions
_______________________________________________________
2. Explain what happens when ‘Initialize all Vusers Before Run’ is checked.
_________________________________________________________________
Performance Monitors
Objectives
After completing this chapter, you will be able to:
8-1
Performance Monitors
• One transaction usually relies on a different set of components and tiers than
another, so the relative performances of various transactions suggest a picture of
those components' performance.
For example, the Search transaction took 30 seconds. This result is considered to be poor
performance.
We know that the process took too long, but we have no way of telling where the
bottleneck occurred. It could have been the Application server, the Network, the Web
server, or the DNS resolution.
Therefore, we must conclude that transaction timings alone are not conclusive enough to
pinpoint a bottleneck.
– Monitors gather data for offline root cause analysis after testing
Performance monitors report performance metrics for a variety of major backend system
components, including firewalls and Web, application, and database servers. Monitoring
these during scenario execution can immediately pinpoint the source of poor
performance. This monitoring may be conducted within the firewall of the application
under test, or behind a remote firewall with the load generators.
In addition to server software monitors described, any NT or UNIX component can also
be monitored at the OS level. This will indicate processor, disk, and memory utilization
and stress. Problems in these areas often suggests a root cause poor performance. For
example, maxed out memory in a Web server suggests that a memory upgrade may
improve performance. Very low activity suggests that a component is not being utilized.
Problems may be found 'upstream.' For example, a database server may show little
activity because of an application server failure.
These monitors are designed to accurately measure the performance of every single tier,
server, and component during the load test. Each type of server monitor has a different
set of metrics. For instance, Web server monitors provide performance data such as
active connections, hits per second, etc. System resource monitors measure CPU usage,
cache hits, page faults, etc.
Note: Apache, Netscape, and IIS performance monitors are included with LoadRunner.
All additional monitors require a seperate license.
Performance Monitors
Online
Monitors
Performance monitors:
• View and collect statistics during scenario execution using LoadRunner Controller
online graphs
License Information
• Performance monitors are licensed by the LoadRunner Controller
– Sets the data sampling rate, error handling, debugging, and frequency settings
for the online monitors.
It is recommended that the frequency of small scenarios be set at 1 and larger scenarios
at 15. The higher the frequency, the less network traffic there will be.
Note: The load generator must be in down status for the frequency to be configurable.
2. From the monitors tab, enable ENABLE TRANSACTION MONITOR. This specifies the
frequency at which the monitor sends updates to the Controller
Configure Monitors
3. Select server machine name and resources to monitor from the dialog
4. Add the load generator’s name and select a platform. Click OK.
This will list all the available measurements for the chosen monitor.
Monitor Measurements
For follow-up load tests, add specific measurements after speaking to the subject matter
experts.
Summary
• Transaction time alone is not enough to isolate performance problems. We need to
know where the time was spent.
• Understood what monitors and measurements to select based on the load testing
goals.
8-16 Summary
Performance Monitors
Make sure that the load generator machine’s status shows “Down”.
c) If not, then select the LOAD GENERATOR and click the DISCONNECT button to
change the status from "Ready" to "Down".
a) Click the Run tab at the bottom of the Controller’s main window.
b) If only 2 graph panes are visible, select VIEW → VIEW GRAPHS → SHOW
FOUR GRAPHS.
b) Click the MONITORS tab and check ENABLE TRANSACTION MONITOR and
select 15 in the FREQUENCY edit box.
__________________________________________________________________
b) Select the machine that you added as a Load Generator machine, and click the
GENERATORS button.
c) Once you are in a Load Generators window click CONNECT. Make sure that
the load generator status changes to “Ready,” then click CLOSE.
b) Click the “+” next to Web Resource Graphs to expand the graph tree (if it
already shows "-", ignore this step).
c) Select “THROUGHPUT” and drag it over HITS PER SECOND - WHOLE SCENARIO
GRAPH.
Note: You will now see that the HITS PER SECOND GRAPH is replaced with THROUGHPUT
graph.
c) Click the ADD button in the MONITORED SERVER MACHINES pane. The ADD
MACHINE dialog opens.
e) Choose the correct version of Windows from the PLATFORM list, then click OK
to close the ADD MACHINE dialog.
g) Click OK to close the WINDOWS RESOURCES dialog and start the monitor.
Notice that each measurement appears on a color-coded row in the bottom pane
of Controller’s main window. Each row corresponds to a line in the graph of
the same color.
Who would you consult for advice on which Windows counters to set?
__________________________________________________________________
__________________________________________________________________
__________________________________________________________________
__________________________________________________________________
_
b) Select “APACHE” from the WEB SERVER RESOURCE GRAPHS, drag it into the
graph view area, and drop it on top of the TRANSACTION RESPONSE TIME
graph.
a) Right-click the Apache graph pane and select "ADD MEASUREMENT(S)" from
the pop-up menu. The Apache dialog opens.
c) Type your machine’s name in the NAME box in the ADD MACHINE dialog. (If
the Apache Web Server is running on a different machine, use that machine’s
name instead.)
f) Click the ADD button in the RESOURCE MEASUREMENTS ON: pane. The
APACHE - ADD MEASUREMENTS dialog opens.
g) Type /server-status? auto in the URL box if it’s not already there.
h) Select the first item in the list, then hold down the Shift key and click the last
item. The entire list should now be selected. Click OK to add all items.
After several seconds you should begin to see lines appear on the Apache graph. If you
do not, there may be a problem with your httpd.conf file.
If you can see data here but no lines in your Apache graph in the Controller
then repeat step 2 and instead of using the machine name, use localhost.
1. Run the Stop Server program in the Mercury Tours program group.
#<Location /server-status>
#SetHandler server-status
#</Location> [the first line where this occurs after SetHandler server-status]
4. In the graph view area you should see Running Vusers, Apache, Throughput, and
Windows Resources monitors.
Review Questions
Test your understanding of this lesson by answering the following questions:
__________________________________________________________________
________________________________________________________________
__________________________________________________________________
________________________________________________________________
Results Analysis
Objectives
After completing this chapter, you will be able to:
9-1
Results Analysis
Any link in the chain between the browser and the database could be the cause of an
application failure or performance degradation.
Performing root cause analysis means drilling down from the most general reports to
localized metrics
How are bottlenecks pinpointed during results analysis? There are typically three
phases:
• Compare results against goals - confirm performance has not met expectations.
• Identify potential bottlenecks - list all the pieces of the system which might have
caused that slowdown.
• Correlate results - determine the most likely culprit by correlating transaction times
and backend monitor metrics.
• The Summary Report should be your first stop after a test run
– This column indicates the maximum response time for ninety percent of the
transactions
– Looking at this column gives you a good idea of the overall performance of the
transactions
Every report in the analysis tool contains valuable data. The data is summarized into a
high-level report in Summary Report. If unacceptable response times and failures are
seen this shows that the load testing did not achieve the desired goal. Employ systematic
strategies to find the root cause of a problem.
Our load testing goal is to be able to support 100 users with < 5 second transaction
response time across all transactions.
Note that we have unacceptable maximum response times and are beginning to see
failures. We will try to identify the cause of these failures in the coming slides.
As we look through the data, we can begin dissecting the problem. Response time
exceeded the goal at about 20+ minutes into the test. What else was happening then?
By looking at the Average Transaction Response Time Under Load, we can see
response time degrades above ~70 users. The goal was to support 100 users at <5
seconds. Clearly, we will need to make changes to the system to support this
business goal. But where is the problem?
The project manager has defined the Service Level Agreement as 99.9% (or greater!).
With failing transactions and unacceptable response times, this problem is causing
sleepless nights and missed Service Level commitments. Or is it? Which customers are
being affected?
By drilling down on a transaction (Credit), we can see that most of the customers seem
to be within the Service Level. However, there are still far too many transactions
exceeding the 5-second threshold.
• Drill-Down capability.
Once you have applied the desired settings you can save the session as a template and
apply the same template to other results files. Templates enable you to save the current
filter and display options and use them in another session.
You save, apply, and edit templates using the Template dialog box.
Note: To get more info on this go to books onlines and click on LoadRunner Analysis
User’s Guide book.
1. Click the “+” <New Graph> icon on the toolbar menu. The Open a New Graph
window opens.
Drilling Down
3. Select a Transaction.
Drill-Down Options: Let’s focus on a specific measurement within your graph. You
select one measurement within the graph and display it according to desired grouping.
For example, the Average Transaction Response Time graph shows one line per
transaction by default. To determine the response time for each host, drill down on one
transaction and sort it according to host. The graph displays a separate line for the
transaction response time on each host.
Setting Filters
• Filters let you display only a specific transaction status, transaction name, group,
Vuser, or other condition in the Summary Report.
• Select criteria and values for each filter condition that you want to employ.
• After the results are processed by the Analysis tool, the file is saved with the .lra
extension.
• If you want to do cross scenario analysis of the results, then do not delete the .lrr
files.
• Cross scenario analysis can only be done if the .lrr file is available.
• As load increases, the throughput and hits graphs should reflect the increase.
By looking at these three graphs, we see that Running Vusers, Hits per Second, and
Throughput graphs all correlate. As an analogy, think of a busy highway as your
network. The throughput can be represented by the ability of the highway to handle the
traffic. At the highway’s saturation point, the cars begin to bottleneck, and the number
of cars on the road flattens out to the maximum. A bandwidth issue occurs, if throughput
has flattened out while the number of Vusers increases
Additionally, the number of Hits per second is like a parking lot (web server). Each car
is trying to find a spot, and when the lot is full, the cars are forced to drive around until a
spot opens up. If Hits per second flattens out as Vusers increase, there is likely a web
server connection issue.
Since there is a direct correlation with Vusers, Hits and Throughput, it does not seem
likely that we have a network issue. Let’s validate that the network was “clean”.
• Network Sub-Path Time shows a “hop” with spikes, confirming network issues.
By looking at the Network Delay time and Sub-Path Time, we can see that the average
latency on the network during the test was low and consistent. Consult your Network
Subject Matter Expert if the data is not meaningful.
• Monitoring systems during a test will help find bottlenecks and misconfigurations.
We have eliminated the network as the cause of our response time issues, and we also
believe that our web server handled the number of connections we requested. However,
the web server is not eliminated yet from being the bottleneck. Other configuration
settings affect transaction response time.
We begin to notice that CPU on the Web server seems to be consistently running at 80%
after 5 minutes into our test. Our problems began at ~20 minutes, so we now need to
identify what other resources were affected between the 5 minute-mark and the 20
minute-mark of the test.
• Servers should exhibit an average processor utilization of less than 70% during
normal load.
• Servers should also maintain physical memory availability throughout the test.
We have identified the issue. As a resolution, we will need to increase physical memory
and retest to measure the effectiveness of this change. Once again, the data might be
more meaningful to the server administrators. Do not hesitate to involve Subject Matter
Experts (SMEs.)
Interpreting Graphs
When you see a measurement in the graph flatten out, it means that the hardware or
software has reached it’s capacity and cannot handle any extra load.
• A connection graph that flattens out under increasing load may signify a Web server
issue.
• A throughput graph that flattens out under increasing load suggests a network
bandwidth issue.
• Time to First Buffer is the period between a browser request and the first reply.
Now that we have “solved” our Root Cause Analysis, let’s look at other data from LR
Analysis.
With regard to Time to First Buffer, it is useful to isolate “Server” vs. “Network” in an
effort to quantify where a majority of the time is spent. Here, we can see that the
“Server” has been identified as the bottleneck. However, in complex
infrastructures, there are likely many servers, and we would need to diagnose
further.
• Identifies Web pages that take the most time and isolates where time is spent.
• Helps isolate DNS resolution issues, SSL issues, and connection issues.
After we identify server vs. network, we need to drill down to the specific metric that is
causing an issue. LoadRunner dissects these transactions into the different components
of a request. Any connection issues, SSL issues, DNS issues, or FTP issues will show up
in the Page Download Time Breakdown graph.
• Allows automatic selection of graphs to correlate in order to find the metrics that
most influence the transaction response time
• Automatically correlates the transaction graph with all performance metrics and
displays the ones that show the highest match in their behavior; this allows you to
disregard irrelevant metrics
Auto Correlation lets you correlate a measurement in a graph with other monitor
measurements during a specific time range of the scenario. This enables you to view
similar measurement trends.
Correlating the response time with each metric and identifying the metrics that are most
likely correlated poor response time can takes a lot of time. This is due to the number of
metrics each graph displays. Auto Correlation allows you to do this without any trouble
and in less time.
1. Right-click on any graph and select AUTO CORRELATE (or from the toolbar menu
select VIEW→ AUTO CORRELATE). This will open the Auto Correlate window.
2. Select either TREND or FEATURE in the SUGGEST TIME RANGE BY BOX. Trend
demarcates an extended time segment which contains the most significant changes.
Feature demarcates a smaller dimension segment which makes up the trend.
3. Click BEST for the segment of the graph most dissimilar to its adjacent segments.
4. Click NEXT for further suggestions, each one being successively less dissimilar.
If the SUGGEST TIME RANGE AUTOMATICALLY box is checked, then suggestions are
automatically invoked whenever the Measurement to Correlate item changes.
Alternatively, you can manually specify the FROM and TO values of a time period in
the TIME RANGE tab (in hh:mm:ss format). You can also manually drag the green
and red vertical drag bars to specify the start and end values for the scenario time
range.
5. If you applied a time filter to your graph, you can correlate values for the complete
scenario time range by clicking the DISPLAY button in the upper right-hand corner
of the dialog box.
1. To specify the graphs you want to correlate with a selected measurement and the
type of graph output to be displayed, click the Correlation Options tab.
2. In the SELECT GRAPHS FOR CORRELATION section, choose the graphs whose
measurements you want to correlate with your selected measurement:
• In the DATA INTERVAL section, select one of the following two options:
– Correlate data based on X second intervals: Enter the number of seconds you
want the Analysis to wait between correlation measurement polls.
– Show the X most closely correlated measurements: Specify the number of most
closely correlated measurements you want the Analysis to display.
• Word Format
– Can add comments and format the analysis data based on your needs.
HTML Reports - The Analysis tool lets you create HTML reports for your
scenario run. It creates a separate report for each open graph and a Summary report. This
Summary report is identical to the Summary report that you access from the Analysis
window. This report also provides a link to an Excel file
containing the graph data. Refer to the LoadRunner documentation on how to create
HTML reports.
3. 3. Specify a path and file name for the HTML report and click OK.
The Analysis saves a Summary report called by the file name in the selected folder,
and the rest of the graphs in a folder with the same name as the file name. When you
create an HTML report, the Analysis opens your default browser and displays the
Summary report.
Word Reports - The Analysis tool provides a simple interface that allows you to create
an Analysis report in MS Word format.
Creating the Word reports: (Instructor will demo this)
2. Set the options you require in the FORMAT tab and press OK.
The report is then generated, and a window appears to reporting its progress. When
the report is completed, Analysis launches the Microsoft Word application to
display the report. The file is saved to the location specified in the Report Location
box of the Format tab.
FORMAT OPTIONS allow you to add custom information to the Word report, as well
as to include additional pages and descriptive comments. To learn more on creating
Word reports, refer to the LoadRunner documentation.
Summary
• Monitor all components in your application to generate data graphs
9-30 Summary
Results Analysis
a) If the LoadRunner program is open, click the ANALYZE LOAD TESTS link
from the Load testing tab. This launches the Analysis program.
a) When LoadRunner finishes processing the results data, it displays the Analysis
Summary. Look at the Transaction Summary.
How many passed and failed transactions does the Transaction Summary show?
What percentage of all transactions failed?
__________________________________________________________________
________________________________________________
4. Open the Apache graph (from the Web Server Resources category).
b) Click "+" to expand the graph tree and the WEB SERVER RESOURCES graph.
a) Hold down the Shift key, then, in the grid below the Apache graph, click the #BUSY
SERVERS (APACHE) and #IDLE SERVERS (APACHE) rows.
What do you notice about the Busy and Idle Servers lines in the Apache graph?
__________________________________________________________________
________________________________________
__________________________________________________________________
________________________________
What would you guess caused the purchase_flight transaction to peak higher than
any other transaction?
__________________________________________________________________
________________________________________________________________
8. Save the session and close the Analysis window when you are finished.
Note: If you were conducting a real load test on your system, at this point you would
analyze the test results and report your findings to the system experts. They should then
tune the system to optimize it for 100% load.
a) In the Analysis window, select FILE → CROSS WITH RESULT. The CROSS
RESULT dialog opens with scenario_ex_25Vusers.lrr already in the list.
b) Click the ADD button. The Open Result File for New Analysis Session dialog
opens.
c) Navigate to \training\loadrunner\Results\scenario_ex_20Vusers,
select the file scenario_ex_20Vusers.lrr, and click OPEN.
e) Click YES if you see a message asking if you want to open the default graphs.
In the grid below the graph, uncheck the boxes for all transactions except the ones
in the table below.
BookFlight_Transaction
purchase_flight
How much did the average transaction response time vary as more Vusers were
added?
__________________________________________________________________
________________________________________________________________
According to the Throughput graph, how much did the average throughput decline
as more Vusers were added?
__________________________________________________________________
________________________________________________________________
Overall, do you think that the difference between 25 and 20 Vusers was small
enough that you would feel confident allowing the higher load on your system?
__________________________________________________________________
________________________________________________________________
5. When you have finished analyzing the results, save the analysis session as:
\training\loadrunner\Results\cross_results_analysis.
Understand the architecture and load testing goal for the Web site before you answer the
questions.
– Simultaneously perform login, payment image select, and logout with 150
concurrent Vusers.
– The average transaction response time for each of the 3 business processes
should not exceed 16 secs.
• Architecture —
a) If the LoadRunner main screen is open, click the ANALYZE LOAD TESTS link
from the LOAD TESTING tab. This launches the Analysis program.
Was the system able to handle the number of concurrent Vusers specified in the
load testing goal?
__________________________________________________________________
________________________________________________________________
4. Merge the Running Vusers graph with the Average Transaction Response Time
graph.
a) Right-click the RUNNING VUSERS graph and select MERGE GRAPHS from the
pop-up menu. The MERGE GRAPHS dialog opens.
d) Click OK to merge the graphs and close the MERGE GRAPHS dialog.
How many Vusers were able to run concurrently before the response time goal was
exceeded?
__________________________________________________________________
________________________________________________________________
What could be some of the possible reasons for high response times for the
Payment image select transaction?
__________________________________________________________________
________________________________________________________________
Assume that you are the performance engineer. What steps would you follow to
find the root cause for the high response time of the Payment image select
transaction.
__________________________________________________________________
________________________________________________________________
Objectives
This appendix contains the final task that you will perform in this course. This task will
test the skills you learned for building an effective scenario that achieves the defined
performance testing objective. This task is optional.
A-1
Project (Optional)
Acceptable response times means that the test objective was achieved.
Poor response times means that the system or application needs some tuning.
Unacceptable means that the system or application needs to be adjusted and the
scenario needs to be rerun to achieve the test objective.
Your task in this scenario is to determine performance under load. For building this
scenario use the script name ProjectScript located under
\training\loadrunner\Scripts\. For this performance testing objective your
tasks are:
3. Analyze the scenario results to determine whether or not the performance testing
objectives were achieved.
1. Specify the Run-time settings you used during the following scenario execution:
Debug run
Scalability 100++%
2. How many Vusers could you run before your CPU usage hits 100%?
______________________________________________________________
______________________________________________________________
3. At what number of Vusers did the Apache servers performance start degrading
below the acceptable response time?
4. Examine the analysis results and explain whether or not the scenario achieved the
performance testing objective.
______________________________________________________________
______________________________________________________________
Appendix B: Introduction to
Internet Protocols
Objectives
Learn the Internet model used for browser based applications.
B-1
Introduction to Internet Protocols
Figure B-1
In any computer program, there is a model that allows the developer to write
applications easily without knowledge of the physical network. The translation from
“what a human wants to see on the screen” to “what a computer or network needs in
order to move data” is handled by this model.
Early applications were developed to follow the OSI model. Internet applications follow
the TCP/IP (Internet) model.
Each layer of the model automatically handles the previous layer. This simplifies
development, since developers no longer need to write code for each layer. For instance,
Web application written to the HTTP standards work whether you are coming from a
Token Ring network or an Ethernet Network. TCP/IP “simplifies” the OSI model to
combine Layers 5-7 into a single “layer”. The suite of “applications” available represent
the different types of applications that move data across the Internet, the need for
reliable transport, and the means of establishing a session. The application layer also
represents the interface to the user, such as Internet Explorer or Netscape Navigator.
Later in this lesson, you will see the importance of the TCP/IP Model to Vugen.
Figure B-2
Figure B-3
The port number identifies a socket that runs a specific server. Most applications run
under the default port number, but it is possible for a developer to change to a different
port number. If you do not specify a port number in the URL, the browser automatically
directs your requests to a default port. The above table lists some typical Web server
port assignments.
Note: The previous example specified port 80 (which is the default) for HTTP. It is not
necessary to specify the default port. However, if using a “custom port”, it is absolutely
necessary to specify the custom port in the URL.
HTTP/S
• Hyper-Text Transfer Protocol/Secure is the industry standard means of
communicating with web based applications
• Most conversations between a client (Browser) and a server (Web Server) occur via
HTTP/S
HTTP/S B-5
Introduction to Internet Protocols
Figure B-4
What is a Header?
Figure B-5
One of the most important pieces of information returned in a header is the status code.
The status code identifies the nature of the returned response: good or poor.
Figure B-6
By checking the header for the status code, we can determine if the web server is
responding well. If we start to see errors (4XX and 5XX), we know that the web server
is not responding well.
Later on, when we start load testing, these errors are the ones that we will be measuring!
Browser Functions
• Manages the Application Layer translation from HTTP to HTML
• Can manage other Internet Protocols such as FTP, Telnet, and SMTP in a common
user interface
The browser is the user interface for requesting resources from the web application.
Initially, users will identify a URL that they wish to interact with, and from that point
they request resources in the context of the application. In other words, users typically
only need to manually request resources one time, and the application formats the
appropriate URLs for any additional requests through the application interface.
As the page is interpreted by the browser, more resource requests may be automatically
issued and downloaded. Typically, a browser can handle 4 simultaneous requests
(connections) at any single time. Any other request must wait for an open connection.
HTML
• Hyper-Text Markup Language is the development environment for the Web
• It is parsed (interpreted) by the browser to render the Web page returned by the
server
HTML B-11
Introduction to Internet Protocols
Summary
• The Internet Model (TCP/IP) is used for browser based applications
• The suite of programs that makes up TCP/IP are HTTP, Telnet, SMTP, POP3, FTP,
etc.
B-12 Summary
Installation Guidelines When a Firewall is Present
Appendix C: Installation
Guidelines When a Firewall is
Present
Objectives
After completing this chapter, you will be able to:
C-1
Installation Guidelines When a Firewall is Present
Figure C-1
When the Controller is inside the firewall, it has direct access to the load generator
machines.
Figure C-2
When the Controller is outside the firewall, the direct connection between the Controller
and the load generator machine is blocked by the firewall. The connection cannot be
initiated by the Controller because it does not have permission to make an opening in the
firewall.
Figure C-3
LoadRunner Solution
Figure C-4
In order to establish communication between the controller and the load generators, you
need to install MI Listener and the MoFW agent. Normally the MI Listener is installed
on the same machine as the Controller, but it may be on a separate machine (as shown in
the example above). MI Listener and MoFW must be installed on Windows machines.
MI Listener and the Controller may be inside or outside the firewall, but both must be on
the same side of the firewall.
The MoFW (Monitoring Over Firewall) agent connects to MI Listener through port 443
of the firewall. After that connection is established, the Controller connects to MI
Listener through port 50500 of the MI Listener machine. That connection opens
communication through the firewall for the Controller to communicate with load
generators on the other side.
Figure C-5
Figure C-6
Figure C-7
Figure C-8
Figure C-9
Appendix D: IP Spoofing
Objectives
After completing this chapter, you will be able to:
• Understand how routing tables and load balancing systems use IP addresses
D-1
IP Spoofing
About IP Spoofing
• IP Spoofing is useful if:
IP Spoofing has specific requirements which make it not useful for some systems.
If, for example, your load balancer uses the “least busy” method or the “round-robin”
method, then IP Spoofing is not for you.
D-3
IP Spoofing
Figure E-1
Some systems employ load balancing configurations to maximize overall speed and
efficiency. Typically, such systems are applied to Web servers and use the IP address of
the originating client to distribute requests.
Figure D-2
Routers, like hubs and Web servers, know where to send a packet of information. It
references the final destination in its internal routing table and retrieves the IP address of
the packet’s next step.
D-6 Routing Tables Use Destination Addresses to Find a Packet’s Next Step
IP Spoofing
Figure D-3
The results of a Web query must be forwarded by the Web server back to the query’s
originator. The client’s IP address is indexed in the Web server’s routing table.
In the example above, the client at 25.20.255.200 sent a request to the Web server
(101.101.101.1), and the request was passed along to the appropriate application and
database servers. Their results were sent back to the Web server, which looked up the
originating client’s IP address, in its routing table. Here the Web server found that
packets to that client should be sent to router 33.33.33.33.
Figure D-4
Figure D-5
If, during load testing, all requests appear to be originating from a single IP address (or a
narrow range of IP numbers), the load may not be distributed realistically through
various parts of the system.
Figure D-6
• An unbalanced load test may invalidate some, if not all, of the test results
D-12
IP Spoofing
IP Spoofing Issues
Figure D-7
IP Spoofing Issues
Figure D-8
The IP Wizard
Figure D-9
By inputting the Web server’s IP address, the IP Wizard can compare this address with
the client IP addresses. If they do not reside on the same network, updates to the routing
table are required.
If the Web server’s IP address is not entered, the server’s routing table must be manually
updated by executing scripts named at the end of the wizard. In practice, it is simpler to
enter the server’s IP address at this point.
The IP Wizard
Figure D-10
• Clicking the ADD button allows the user to enter IP addresses to be “spoofed”
during scenario execution
Figure D-11
• When testing an intranet or a small LAN system, enter a range of numbers to represent
users on this closed system
Figure D-12
• To simulate usage from many parts of the Internet, select the DON’T USE ANY OF THESE
option and enter several completely unique IP addresses
• Consult the network administrator responsible for the load balancing system to learn which
IP addresses can be used to create a balanced load across the entire system
The IP Wizard
Figure D-13
• To ensure an automatic update of the Web server’s routing table, check the appropriate box
at the end of the wizard
Figure D-14
• After the Web server has been rebooted, open the Controller and enable the IP Spoofer
from the Scenario menu
Figure D-15
Figure D-16
During load testing with the IP Spoofer enabled, requests seem to originate from a
spectrum of client addresses. Consequently, the entire system is realistically tested.
Summary
• IP Addresses
• IP Spoofing
Summary D-23
IP Spoofing
D-24 Summary
Class Evaluation Form
(http://www.merc-training.com/survey/publictraining)
On-line
Through a Resource Coordinator
Someone else registered me
2. How much do you agree with the following statements regarding the registration process and facility?
(Please circle only one rating for each category):
Strongly Strongly
Agree Neutral Disagree N/A
Agree Disagree
My registration was handled efficiently. 5 4 3 2 1 -
The classroom/facilities were clean and well 5 4 3 2 1 on-site
maintained.
The classroom equipment worked properly and 5 4 3 2 1 on-site
effectively supported the class.
4. If there was CBT pre-work that was to be completed before class, did you complete it?
Very helpful Somewhat helpful I’m not sure Not very helpful Not helpful at all
5 4 3 2 1
6. How would you rate your technical ability going into the class?
5 - Highly technical
4 - Above average
3 - Average
2 - Below average
1 - Not at all technical
7. How would you rate your familiarity with the product going into the class?
8. How much do you agree with the following statements regarding the course content and materials?
Strongly Strongly
Agree Neutral Disagree
Agree Disagree
The objectives laid out in the course description were met. 5 4 3 2 1
The course materials were clearly written and easy to follow. 5 4 3 2 1
There was an appropriate amount of content - not too packed 5 4 3 2 1
or too lean.
The lab exercises were well constructed and relevant. 5 4 3 2 1
The graphics in the course materials were clear and effective. 5 4 3 2 1
I would recommend this course to others. 5 4 3 2 1
Strongly Strongly
Agree Neutral Disagree
Agree Disagree
The instructor had a thorough knowledge of the course 5 4 3 2 1
content.
The instructor encouraged participation from students. 5 4 3 2 1
The instructor was an effective communicator. 5 4 3 2 1
The instructor conducted the class at an appropriate pace.
The instructor made the course relevant by using real- 5 4 3 2 1
world examples.
I would recommend this instructor to others. 5 4 3 2 1
12. How would you rate your overall experience with this class?
14. What recommendations do you have to improve the overall effectiveness of this course?
15. What other courses would you like to see offered by Mercury Education Services?
16. If you have any other comments, please enter them below. If you would like to be contacted regarding
your comments, please include your name and contact information.