7 performance testing

Upload: panneer1981

Post on 13-Apr-2018

224 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/27/2019 7 Performance Testing

    1/19

    Unit 40: Software Testing

    Performance Testing

  • 7/27/2019 7 Performance Testing

    2/19

    Agenda

    1. Performance Test Planning

    2. Performance Test Execution

    3. Performance Analsis! Tuning

  • 7/27/2019 7 Performance Testing

    3/19

    Terms ou need to "now

    Performance is concerned with achieving response times, throughput,resource utilization levels that meet you performance objectives

    Scalability refers to the ability to handle additional workload, withoutadversely affecting performance, by adding resources such as P!, memoryand storage capacity

    Throughput is the number or re"uests that can be served by yourapplication per unit time#

    $esource !tilization is the cost in terms of resources% P!,memory, disk &'(, network &'(

    Server)atency* is the time the server takes to complete the e+ecutionof a re"uest# Server latency does not include network latency additional timethat it takes for a re"uest and a response to cross a network#-

    .orkload typically derived from marketing data# &ncludes total number ofusers, concurrent active users, data volumes and transaction volumes, alongwith the transaction mi+#

  • 7/27/2019 7 Performance Testing

    4/19

    #ntroduction

    .hen designing an application that will be accessedover the &nternet, development teams must keep inmind that hundreds of thousands of users couldconcurrently access the application#

    This concurrent user load could% place tremendous stress upon a system resource usage-, cause une+pected delays, and result in a poor user e+perience#

    /owever, if the application has been ade"uatelytested and tuned for optimal performance understress, managers and software developers will beconfident that their code will perform at optimal levelsand have the necessary data to plan site capacityneeds#

  • 7/27/2019 7 Performance Testing

    5/19

    Performance Testing Ste$s:

    Ste$ 1% Planning0# 1efine ritical Performance 2etrics

    3# 1efine 2in'2a+ 4alues of Performance 2etrics

    5# reate Site !sage Profile

    6# reate Performance Testing 7nvironment

    Ste$ 2% 1esign and $un Performance Tests0# reate dynamic scripts

    3# 4erify script functionality

    5# 7+ecute Performance Tests

    Ste$ 3% Performance 8nalysis, Tuning and$eporting 9etwork, ode, 8SP#97T, S:) analysis

    Performance Tuning

  • 7/27/2019 7 Performance Testing

    6/19

    %ig&'le(el $erformance goals

    Performance goals are critical to ensure our

    )e* a$$lication meets or exceeds currentor future $ro+ected re,uirements#

    /ow to specify performance goals;

    The best approach is to use historical data ore+tensive marketing research#

    7+amples of poor planningare e*commerce

    .eb applications that can

  • 7/27/2019 7 Performance Testing

    7/19

    Esta*lis& Performance -riteria

    7arly in 1evelopment ycle, testers and

    system analysts work together to compose$e"uirements specification document todefine theperformance criteriafor theapplication being developed#

    8n e+ample of performance re"uirement% When 500 people access the application at the

    same time, response time for 95% of thetransactions must be within 4 seconds fordatabase request.

    esponse time is e!pected to de"rade for lar"ernumber of users e!ercisin" business andadministrati#e tas$s.

  • 7/27/2019 7 Performance Testing

    8/19

    $eal .orld 7+ample=Site Performance >oals

    ?or 2icrosoft

  • 7/27/2019 7 Performance Testing

    9/19

    Performance o*+ecti(es Performance objectives are usually specified in terms of the

    following%

    1. es$onse time# $esponse time is the amount of time that it takesfor a server to respond to a re"uest#

    1. T&roug&$ut# Throughput is the number of re"uests that can beserved by your application per unit time# Throughput is fre"uentlymeasured as re"uests or logical transactions per second#

    1. )or"load# .orkload includes the total number of users andconcurrent acti#e users, data volumes, and transaction volumes

    1. esource utiliation# $esource utilization is the measure of howmuch server and network resources are consumed by yourapplication# $esources include P!, memory, disk &'(, andnetwork &'(#

    0# ?uture performance growth re"uirements

  • 7/27/2019 7 Performance Testing

    10/19

    Performance isualiation

    Bou can visualize

    performance as four'legged stool

    &f you are going tochange the length ofone leg, you will likelyhave to change at leastone of the other legs aswell if you want thestool to still remainstanding

    es$onse Time

    T&e ends user&ardware

    of concurrent

    usersSoftware 5ogic

  • 7/27/2019 7 Performance Testing

    11/19

    Step 0: Set t&e Testing Parameters and setu$

    t&e en(ironment #dentif Use -ases scenarios- for Testing like

    making a purchase and how the user logs in, selectsa product, and enters credit card information

    7stablish Site Performance 6oals and 7etricslike .eb Page )oad TimeC

    Throughput transactions'sec- for given user scenario $esource !tilization P! and memory-

    2a+imum 9umber of oncurrent !sersC

    1epending on !ser Dandwidth EFk, 03Gk, 3EFk, etc-,/ardware P!, $82, /11 space-

  • 7/27/2019 7 Performance Testing

    12/19

    es$onse Time 6oals #dentif connection s$eeds and latencof your potential customers#

    This can help you determine an acceptable amount of time it can taketo load each page of your .eb application#

    (nce you have identified how your user base will access your .ebapplication, you can determine your res$onse time acce$ta*ilittargets. These targets define how long it can acceptably take for user scenarios or

    content to load on various connections

    ?or e+ample, with all things being e%ual, a 70$kilobyte page will obviouslyload faster on a &'($kbps )*+ connection than on a &$kbps modemconnection -he response time acceptability for your &$kbps modem might be1' seconds, while the &'($kbps )*+ connection might be significantly less, at' seconds

    Predicted Connection Speeds

    User Worst Connection Average Connection Best Connection

    Line Speed 28.8-kbps modem 256-kbps SL !.5-mbps "!

    Latenc# !$$$ mi%%iseconds !$$ mi%%iseconds 5$ mi%%iseconds

  • 7/27/2019 7 Performance Testing

    13/19

    User eaction to es$onse time H#0 second

    is the limit for having the user feel that the system is reactinginstantaneously, meaning that no special feedback is necessary

    e+cept to display the result#

    0#H second is the limit for the user

  • 7/27/2019 7 Performance Testing

    14/19

    T&roug&$ut and -oncurrent User 6oals

    /ow many concurrent usersdo we currently

    sustain or e+pect in a given time period; .hat actionsdoes a typical user perform on our

    .eb application and which pages receive the most

    page views in a given time period;

    /ow many user scenarios will my .eb application

    process in a given time period;

    User &perations 'atio Anticipated Load per (o)r

    Basic Searc( !*+ !,*$$Brose or Prod)ct 62+ 6,2$$

    Add to Cart !$+ !,$$$

    Login and C(ecko)t /+ /$$

    'egister and C(ecko)t /+ /$$

    "ota% !$$+ !$,$$$

  • 7/27/2019 7 Performance Testing

    15/19

    8e Performance 7etrics -riteria

    The breakpoint of your .eb application can

    be defined in various ways# 7+amplesinclude% a server that e+ceeds predefined resource utilization targets,

    too many server errors, or

    unacceptable response times due to processing delays

    Perormance 0etrics and Acceptab%e Leve%s

    0etric Location Acceptab%e Leve%

    CPU )ti%i1ation Perormance 0onitor /5+

    0emor#3avai%ab%e 0B Perormance 0onitor 4 !28 0B

    ASP eec)tion time Perormance 0onitor ! second

    B processing de%a#s SL Proi%er 5$$ mi%%iseconds

    Web tier processing de%a#s "ime "aken ie%d o Web %ogs ! second

  • 7/27/2019 7 Performance Testing

    16/19

    Performance 6rowt& Analsis

    8 performance growth analysisis re"uired if your .eb

    application user base ise+pected to grow over a giventime period

    Execute t&e stress testwithmore load and with higher

    levels of concurrent users topredict future bottlenecks

    The easiest way to determinethe growth capacity of your .ebapplication is to calculate the

    increase in volumeyou arecurrentlye!periencin"over aspecific period of time

  • 7/27/2019 7 Performance Testing

    17/19

    9rom Planning to Execution

    The performance test en(ironmentshould be asclose to the production environment as possible# This

    includes% the server capacity and configuration, network environment, database#

    .hen performance planning is completed, our focusshifts to utiliing software load simulation toolsforpushing .eb applications to their performancebreakpoints#

    The goal during the performance testing phase is todefine t&e real'world $erformance limits for t&e)e* a$$lication#

  • 7/27/2019 7 Performance Testing

    18/19

    Step 3: un Performance Tests

    .ith the software method,user transaction scenariosare t$icall recordedor

    captured by a software tooland converted to test scripts#

    .hen playing back or

    e+ecuting a test script, onemachine typically acts as acontroller to distribute the testscript across multiple clientmachines# 8s the test runs,the controller simulatesman (irtual simultaneoususers.

    .hen the test is complete, itsummaries t&e test data

    from all of t&e clients#These virtual users createload on the backend serversand help to determine thestability and responsivenessof the .eb application

  • 7/27/2019 7 Performance Testing

    19/19

    Step 5: Performance Analsis! Tuning and e$orting

    A$$lication etwor" Analsis

    Network Latency the time it takes for a datapacket to move across anetwork connection#

    Network roundtrips each image, style sheet, or

    other page element definedin the response to yourre"uest from the .ebserver- is counted as aseparate network roundtrip# 8dditional round tripsare involved in the setup ofeach connection to the.eb server

    Data transferred kilobits per second and

    kilobytes of datatransferred

    Ser(er esource Usage Analsis

    Memory usage CPU usage HDD space

    -ode Performance Analsis Shows you where your

    application e+ecution time or

    memory is being utilized inwhich class or method-

    S;5