PT02 Load Runner Fundamentals_1

Embed Size (px)

Citation preview

  • 8/3/2019 PT02 Load Runner Fundamentals_1

    1/75

    TSLLoadRunner Fundamentals

  • 8/3/2019 PT02 Load Runner Fundamentals_1

    2/75

    TRAINING SCHEDULE

    Day 1

    Basics of Performance Testing

    Why LoadRunner?

    Basics of LoadRunner Components

    Installing LR ComponentsPlanning an Effective Load Test

    Scenarios

    Using Run-Time Settings

    Scenario Execution

    Scheduling Scenarios

    Performance Monitors

    Results Analysis

    Day 2

    Record and Replay

    Transactions

    Parameterization

    CorrelationVerification

    Analyzing Graphs/ Discussion

  • 8/3/2019 PT02 Load Runner Fundamentals_1

    3/75

    Basics of Performance Testing

  • 8/3/2019 PT02 Load Runner Fundamentals_1

    4/75

    What is Testing?

    A process to ensure the accuracy, completeness and quality of developed software.

    "... the process of exercising or evaluating a system or system component by

    manual or automated means to verify that it satisfies specified requirements or to

    identify differences between expected and actual results ..."

    .

    Manual Testing The The part of software testing which requires human input,analysis, or evaluation.

    Automation Testing The software testing where the input, analysis etc, are done

    through automated means. We use test automation tools like QTP, LoadRunner,

    Silktest, Test Director.

    1: Basics of Performance Testing

  • 8/3/2019 PT02 Load Runner Fundamentals_1

    5/75

    Types of Testing:

    Functional Testing- The testing that ignores the internal mechanism of a system or

    component and focuses solely on the outputs generated in response to selected

    inputs and execution conditions. It ensures that the program physically works the

    way it was intended and all required menu options are present. It also ensures that

    the program confirms to the industry standards relevant to that environment.

    Non-functional Testing- Non Functional Testing suggests "HOW WELL" the product

    behaves. This HOW WELL definition is with reference to ease of use, reliability,

    performance, security etc.

    1: Basics of Performance Testing

  • 8/3/2019 PT02 Load Runner Fundamentals_1

    6/75

    Performance Testing

    Performance testing is testing that is performed to determine how fast some

    aspect

    of a system behaves under a particular workload.

    Performance testing is carried out to prove that an application meets certain

    performance requirements set down by the customer.

    Primarily used to determine:

    Capacity of existing systems.

    Benchmarks for future systems. Degradation with various loads.

    1: Basics of Performance Testing

  • 8/3/2019 PT02 Load Runner Fundamentals_1

    7/75

    Need of Performance Testing

    Speed

    Does the application respond quickly enough for the intended users?

    Scalability (Capacity)

    Will the application handle the expected user load and beyond?

    Stability

    Is the application stable under expected and unexpected user loads?

    What happens if user gets disconnected or web server gets down?

    Confidence

    Are you sure that users will have a positive experience on go-live day?

    1: Basics of Performance Testing

  • 8/3/2019 PT02 Load Runner Fundamentals_1

    8/75

    Examples of Performance Test Objectives

    1: Basics of Performance Testing

  • 8/3/2019 PT02 Load Runner Fundamentals_1

    9/75

    Manual Testing is Problematic

    1: Basics of Performance Testing

  • 8/3/2019 PT02 Load Runner Fundamentals_1

    10/75

    How can site developers generate enough load to enable testing?

    How can I obtain sufficient testing personnel and client machines?

    How can I synchronize users?

    How do I measure the results?

    How can I repeat the test after identifying and fixing problems?

    Limitations of Manual Testing

    1: Basics of Performance Testing

  • 8/3/2019 PT02 Load Runner Fundamentals_1

    11/75

    Why LoadRunner?

  • 8/3/2019 PT02 Load Runner Fundamentals_1

    12/75

    Load testing your application provides many potential benefits:

    Preventing costly failures of mission-critical applications.

    Assuring performance and functionality under real-world conditions.

    Locating potential problems before your customers do.

    Reducing development time.

    Reducing infrastructure costs.

    Why Load Test your Application?2: Why LoadRunner?

  • 8/3/2019 PT02 Load Runner Fundamentals_1

    13/75

    LoadRunner Solution

    2: Why LoadRunner?

  • 8/3/2019 PT02 Load Runner Fundamentals_1

    14/75

    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 Solution

    2: Why LoadRunner?

  • 8/3/2019 PT02 Load Runner Fundamentals_1

    15/75

    LoadRunner Terms and Definitions

    Vuser: Virtual users or Vusers emulate the steps of the real users. The steps that Vusersperform are recorded in a Vuser script.

    VuGen: Virtual User Generator (VuGen) records Vuser scripts that emulate the steps ofreal users using the application.

    Scenario: A scenario is a file that defines the scripts to execute, the number of Vusers torun, the goals of the test, the computer that will host the Vusers, and the conditions

    under which the load test runs.

    Controller: The Controller is the machine you designate to manage and maintain yourscenarios and allows you to control all the Vusers of the scenario from a single location.

    Performance Monitors: Real time monitors capture performance data across all tiers,servers and network resources and display information on the Controller.

    2: Why LoadRunner?

  • 8/3/2019 PT02 Load Runner Fundamentals_1

    16/75

    Basics of LoadRunner Components

  • 8/3/2019 PT02 Load Runner Fundamentals_1

    17/75

    Basics of LoadRunner Components

    Convert this to Text!!

    3: Basics of LoadRunner Components

  • 8/3/2019 PT02 Load Runner Fundamentals_1

    18/75

    LoadRunner Launch Screen3: Basics of LoadRunner Components

  • 8/3/2019 PT02 Load Runner Fundamentals_1

    19/75

    How do LoadRunner Components interact?3: Basics of LoadRunner Components

  • 8/3/2019 PT02 Load Runner Fundamentals_1

    20/75

    Load Testing Process3: Basics of LoadRunner Components

  • 8/3/2019 PT02 Load Runner Fundamentals_1

    21/75

    Load Testing Process

    Planning Gather and document all relevant information about the system for theload test.

    Create Vusers Use the Virtual User Generator (VuGen) to automate user actionsof the selected business processes that you will test.

    Create ScenariosUse LoadRunners Controller to set up the load testenvironment by putting together the target hardware, the intended Virtual Users

    (Vusers), and the conditions under which the load test will be run.

    Run Scenarios & Analyze Results Run the load test and compile the results foranalysis using LoadRunners Controller. Use the analysis tools to organize and display

    the results.

    Tune the System Analysis of results should reveal areas of the system that requireadjustment. Once the adjustments are made, repeat the load test to confirm that

    system adjustments had the desired effect.

    3: Basics of LoadRunner Components

  • 8/3/2019 PT02 Load Runner Fundamentals_1

    22/75

    LoadRunner Expert Workflow The Big Picture3: Basics of LoadRunner Components

  • 8/3/2019 PT02 Load Runner Fundamentals_1

    23/75

    LoadRunner Components in the Workflow3: Basics of LoadRunner Components

  • 8/3/2019 PT02 Load Runner Fundamentals_1

    24/75

    Installing LoadRunner Components

  • 8/3/2019 PT02 Load Runner Fundamentals_1

    25/75

    Installing LR Components

    4: Installing LoadRunner Components

  • 8/3/2019 PT02 Load Runner Fundamentals_1

    26/75

    Installing VuGen4: Installing LoadRunner Components

  • 8/3/2019 PT02 Load Runner Fundamentals_1

    27/75

    Installing the Controller4: Installing LoadRunner Components

  • 8/3/2019 PT02 Load Runner Fundamentals_1

    28/75

    Installing the Load Generator4: Installing LoadRunner Components

  • 8/3/2019 PT02 Load Runner Fundamentals_1

    29/75

    Installing Analysis4: Installing LoadRunner Components

  • 8/3/2019 PT02 Load Runner Fundamentals_1

    30/75

    Planning an Effective Load Test

    l ff d

  • 8/3/2019 PT02 Load Runner Fundamentals_1

    31/75

    Planning an Effective Load Test

    Expert Workflow

    5: Planning an Effective Load Test

    5 Pl i Eff i L d T

  • 8/3/2019 PT02 Load Runner Fundamentals_1

    32/75

    How to Define Goals

    When you define goals, the first step is to channel general application

    performance expectations into conceptual goals.

    Conceptual goals should outline all of your load objectives

    Some examples of conceptual goals and their relative priority might include thefollowing:

    A high-priority example would be the responsiveness of a Search function.

    Are we able to get search results within a reasonable time?

    A second example is the system administrator's concern that the Update

    transaction functions well during heavy usage.

    In the initial stages, jotting down immeasurable goals will allow later filtering in

    order to arrive at more focused goals, as well as to cover all objectives for load

    testing.

    5: Planning an Effective Load Test

    5 Pl i Eff ti L d T t

  • 8/3/2019 PT02 Load Runner Fundamentals_1

    33/75

    Gather System usage Data

    Expert Workflow

    5: Planning an Effective Load Test

    5 Pl i Eff ti L d T t

  • 8/3/2019 PT02 Load Runner Fundamentals_1

    34/75

    Business Process

    A business process is a set ofactions or user steps performed within an application toaccomplish a business goal.

    Examples of Business Process

    5: Planning an Effective Load Test

    5 Pl i Eff ti L d T t

  • 8/3/2019 PT02 Load Runner Fundamentals_1

    35/75

    Gathering System Usage Data

    By gathering system usage data you can:

    Decide which business processes to record

    Isolate peak loads and peak load times

    Document user actions and valid input data for each business process.

    The first task is to understand the application to be load tested. This mayinvolve:

    First-hand use of the site.

    Consultation with administrators to understand the nuts and bolts of the

    infrastructure.

    Consultation with executives to understand the aspirations and expectations of thesite.

    Research of competing sites to understand the level of service in the marketplace.

    5: Planning an Effective Load Test

    5: Planning an Effective Load Test

  • 8/3/2019 PT02 Load Runner Fundamentals_1

    36/75

    Which processes to test ?

    Mission Critical

    Transactions on which your business depends on.

    Heavy Throughput

    Business processes that may not be mission-critical but are very popular.

    Dynamic Data

    Any business process that relies on dynamic content is more likely to fail

    during periods of heavy load than one based on static content.

    5: Planning an Effective Load Test

    5: Planning an Effective Load Test

  • 8/3/2019 PT02 Load Runner Fundamentals_1

    37/75

    Business Processes to record

    5: Planning an Effective Load Test

    5: Planning an Effective Load Test

  • 8/3/2019 PT02 Load Runner Fundamentals_1

    38/75

    Business Processes to record

    5: Planning an Effective Load Test

    5: Planning an Effective Load Test

  • 8/3/2019 PT02 Load Runner Fundamentals_1

    39/75

    Business Processes to record

    5: Planning an Effective Load Test

    5: Planning an Effective Load Test

  • 8/3/2019 PT02 Load Runner Fundamentals_1

    40/75

    Measure Steps by Defining Transactions

    LoadRunner Transaction

    A LoadRunner transaction is an end-to-end measurement of time elapsed in the

    execution of one or more steps in a business process.

    Preferred and Unacceptable Response Times

    Types of Response Times

    Preferred response timeis the time the business process takes to complete under

    ideal conditions.

    Preferred response time rangeis the time you want the business process to

    complete, having taken slowdown factors into consideration.

    5: Planning an Effective Load Test

    5: Planning an Effective Load Test

  • 8/3/2019 PT02 Load Runner Fundamentals_1

    41/75

    Documenting User Steps and Input Data

    Determine Valid Test Data to Use

    Valid Test Data Sources

    Master Data

    User Generated Data

    External Data

    5: Planning an Effective Load Test

    5: Planning an Effective Load Test

  • 8/3/2019 PT02 Load Runner Fundamentals_1

    42/75

    Think Time

    LoadRunner Think Time is a measurement of the time that a real user takes to

    pause between the execution of steps.

    Concurrency

    A concurrency is a set of users acting upon an application in a similar manner at the

    same time.

    Concurrency occurs on three levels:

    Application Level

    How many users are active on the system?

    Business Process Level How many users are buying tickets?

    Transaction Level How many users are buying tickets now?

    5: Planning an Effective Load Test

    5: Planning an Effective Load Test

  • 8/3/2019 PT02 Load Runner Fundamentals_1

    43/75

    Application Concurrency

    A Task Distribution Diagram formats the business process and its volume across a

    time line.

    5: Planning an Effective Load Test

    5: Planning an Effective Load Test

  • 8/3/2019 PT02 Load Runner Fundamentals_1

    44/75

    Business Process Concurrency

    5: Planning an Effective Load Test

    5: Planning an Effective Load Test

  • 8/3/2019 PT02 Load Runner Fundamentals_1

    45/75

    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?

    g

    5: Planning an Effective Load Test

  • 8/3/2019 PT02 Load Runner Fundamentals_1

    46/75

    Question key points:

    Duration of Load Test: 120 minutes

    Number of Concurrent Users: 5,000

    Average Length of a Transaction: 5 minutes

    Number of Transactions/ min: ???

    Solution:

    No of transactions performed in 2 hours = Duration of Load Test / Average Length of a

    by a single user Transaction

    = 120 / 5 or 24 Transactions

    No of transactions performed in 2 hours = No of transactions performed in 2 hours by a

    by 5000 users single user * Number of Concurrent Users

    = 24 * 5,000 or 120,000

    Number of Transactions/ min = No of transactions performed in 2 hours by

    5000 users / Duration of Load Test

    = 120,000 / 120 or 1,000 Transactions / min

    g

    5: Planning an Effective Load Test

  • 8/3/2019 PT02 Load Runner Fundamentals_1

    47/75

    User Profile

    Profiling Users

    Helps emulate real world conditions.

    Provides tuning guidelines for the system.

    Increases customer satisfaction and revenue.

    g

    5: Planning an Effective Load Test

  • 8/3/2019 PT02 Load Runner Fundamentals_1

    48/75

    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.

    g

    5: Planning an Effective Load Test

  • 8/3/2019 PT02 Load Runner Fundamentals_1

    49/75

    Quantifying Load Testing Goals

    5: Planning an Effective Load Test

  • 8/3/2019 PT02 Load Runner Fundamentals_1

    50/75

    Analyze the System Under Test

    Analyzing the System:

    Allows you to setup LoadRunner monitors.

    Allows you to effectively coordinate with backend experts.

    Provides system information that helps isolate performance problems.

    Sources of System Information:

    System Administrators

    Backend experts

    Application experts

    Database Administrators

    5: Planning an Effective Load Test

  • 8/3/2019 PT02 Load Runner Fundamentals_1

    51/75

    Understanding the System Components

    System checklist

    5: Planning an Effective Load Test

  • 8/3/2019 PT02 Load Runner Fundamentals_1

    52/75

    Business Process Mapping to Infrastructure Components

    5: Planning an Effective Load Test

  • 8/3/2019 PT02 Load Runner Fundamentals_1

    53/75

    Monitoring Application Components

    5: Planning an Effective Load Test

  • 8/3/2019 PT02 Load Runner Fundamentals_1

    54/75

    Confidential L&T Infotech

    Minimum Hardware Recommendation

    5: Planning an Effective Load Test

  • 8/3/2019 PT02 Load Runner Fundamentals_1

    55/75

    About the Test Environment

    The test environment:

    Should mirror the production system

    Needs business processes that are functioning correctly before running the load

    test

    Should include Benchmark runs which validate the test environment

    Must contain sufficient hardware to generate the load test.

    5: Planning an Effective Load Test

  • 8/3/2019 PT02 Load Runner Fundamentals_1

    56/75

    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 theapplication.

    Validates the functionality of the BP Potentially exposes unknown data dependencies

    Establishes the user footprint

    Evaluate the testing infrastructure against the footprint.

    Do I have enough hardware to generate the user load?

    Do I have enough memory? Do I have enough CPUs?

  • 8/3/2019 PT02 Load Runner Fundamentals_1

    57/75

    Scenarios

    6: Scenarios

  • 8/3/2019 PT02 Load Runner Fundamentals_1

    58/75

    Scenarios

    A scenario is a file that defines the Vusers to execute, the number of Vusers to

    run, the goals of the test, the computer that hosts the Vusers, and the conditions

    under which to run the load test.

    Elements of Scenario:

    6: Scenarios

  • 8/3/2019 PT02 Load Runner Fundamentals_1

    59/75

    Scenarios define the overall load test execution

    Which scripts are to be executed?

    How many virtual users will execute each script, and how suddenly or

    gradually should they begin?

    Which load generators will host the Vusers?

    What is the goal of the load test?

    6: Scenarios

  • 8/3/2019 PT02 Load Runner Fundamentals_1

    60/75

    Controller organizes & manages the scenario elements

    Before scenario execution

    used to design the scenario

    used to initiate the scenario run

    During scenario execution controls each Vuser (initialize, run, pause, stop)

    displays the execution status and messages of each Vuser

    monitors system and network resources

    After scenario execution

    collects and organizes performance data

    launches the Analysis tools (optional)

    6: Scenarios

  • 8/3/2019 PT02 Load Runner Fundamentals_1

    61/75

    Scenario Outlines - Examples

    6: Scenarios

  • 8/3/2019 PT02 Load Runner Fundamentals_1

    62/75

    Creating a New Scenario

    6: Scenarios

  • 8/3/2019 PT02 Load Runner Fundamentals_1

    63/75

    Select Vuser Scripts

    6: Scenarios

  • 8/3/2019 PT02 Load Runner Fundamentals_1

    64/75

    Vuser Groups

    6: Scenarios

  • 8/3/2019 PT02 Load Runner Fundamentals_1

    65/75

    Adding a Vuser Group

    6: Scenarios

  • 8/3/2019 PT02 Load Runner Fundamentals_1

    66/75

    Modifying the Vuser Group Settings

    6: Scenarios

  • 8/3/2019 PT02 Load Runner Fundamentals_1

    67/75

    Manual vs. Goal-Oriented Scenarios

    Manual Scenario

    Manual control over how many Vusers run and at what times.

    Add, start, and stop Vusers interactively during a scenario run.

    Goal-Oriented Scenario Goal may be throughput, response time or number of concurrent Vusers.

    LoadRunner manages Vusers automatically.

    Cannot add, start, or stop Vusers interactively during a scenario run.

    6: Scenarios

  • 8/3/2019 PT02 Load Runner Fundamentals_1

    68/75

    Selecting Load Generators for your Scenario

    6: Scenarios

  • 8/3/2019 PT02 Load Runner Fundamentals_1

    69/75

    Adding a Load Generator

    6: Scenarios

  • 8/3/2019 PT02 Load Runner Fundamentals_1

    70/75

    Defining a New Load Generator

  • 8/3/2019 PT02 Load Runner Fundamentals_1

    71/75

    6: Scenarios

  • 8/3/2019 PT02 Load Runner Fundamentals_1

    72/75

    Configuring Load Generator Settings

    6: Scenarios

  • 8/3/2019 PT02 Load Runner Fundamentals_1

    73/75

    Assigning User Profiles to Load Generators

    Example:

    6: Scenarios

  • 8/3/2019 PT02 Load Runner Fundamentals_1

    74/75

    Assigning Number of Vusers

    Simple Scenarios

    Have a single user script.

    Assign 100% of Vusers to the scriptto profile a group of users performing the same action

    Multiple Script Scenarios

    Use several scripts.

    Assign a percentage of the total Vusers to each profile.

  • 8/3/2019 PT02 Load Runner Fundamentals_1

    75/75

    Using Run-time Settings