Jmeter Day3 Satya

Embed Size (px)

Citation preview

  • 8/14/2019 Jmeter Day3 Satya

    1/41

    Day3Session

  • 8/14/2019 Jmeter Day3 Satya

    2/41

    Questionnaire?

    1.What are the important resources to be considered before

    conducting a load test?

    2.What is the peak load a machine can with stand?3.Why should we distribute load ?

    4.What is Soak test?

    5.What is aWeb-Service?

    6.List some Statistical Metrics.

  • 8/14/2019 Jmeter Day3 Satya

    3/41

    Agenda Load-Distribution

    Purpose

    Pre-requisites

    Process Adding a Plug-in

    Protocols in Jmeter

    JDBC

    SOAP LDAP

    Listeners

    Results and Analysis

  • 8/14/2019 Jmeter Day3 Satya

    4/41

    Purpose:

    Load Distribution is the process of controlling load

    generator machines centrally .It generates load in more

    realistic manner and also give back accurate test results.

    Pre-requisites:

    For load distribution

    Ensure that Jmeter installed in the systems is of sameversion.

    The firewall on both Master and Slave systems

    should be disabled.

    Load Distribution:

  • 8/14/2019 Jmeter Day3 Satya

    5/41

    Architecture

  • 8/14/2019 Jmeter Day3 Satya

    6/41

    Process :

    Slave Machine: Go to Jmeter > bin directory and run jmeter-server.bat

    Open jmeter-server.bat and search for START rmiregistry

    Replace rmiregistry with C:\j2sdk1.4.2\jre\bin\rmiregistry.

    Example: START C:\j2sdk1.4.2\jre\bin\rmiregistry.

    Master Machine:

    OpenJmeter>bin>jmeter.properties file.

    Replace remote hosts=127.0.0.1 with the IP address of

    slave machine.

    (For eg:172.26.3.213,172.26.2.144).

  • 8/14/2019 Jmeter Day3 Satya

    7/41

    Adding plug-in Plug-ins incorporate the feature of extensibility in the tool. To

    Enhance the functionality of the tool, add the readily available

    .jarfiles toD:\Jmeter\lib or D:\Jmeter\lib\extas per the

    requirement.

    Customization:

    Download Jmeters source version to get the source code.Required tool customization can be done by this.

  • 8/14/2019 Jmeter Day3 Satya

    8/41

    Protocols

    Apart from HTTP and HTTPS Jmeter supports wide range

    of protocols viz JDBC ,SOAP ,LDAP .In Jmeterterminology a protocol is represented by Sampler.

    Some Of them are:-

    JDBC

    SOAP

    LDAP

  • 8/14/2019 Jmeter Day3 Satya

    9/41

    JDBC

    Pre-requisites: To use MySQL driver, its .jarfile should be copied to

    the JMeter lib directory.

    Create a database and insert data into tables.

  • 8/14/2019 Jmeter Day3 Satya

    10/41

    JDBC

    Process:

    JDBC Sampler

    1) Create a basic test plan to test a database server.

    2) Add users to the thread group.

    3) Right click on Thread Group>Add>Sampler>JDBC Request.

    4) Right click on Thread group>Add>Configuration Element> JDBC

    Connection Configuration.

    Click on JDBC Request and give the variable name as MySQL

    Select a query type

    Enter the appropriate Query in the Query Field. For Example Enter Select

    * from table name.

  • 8/14/2019 Jmeter Day3 Satya

    11/41

    JDBC

    Connection Configuration:Click on JDBC Connection Configuration and give the following

    details

    Variable name : MySQL (this is the same name given in

    the variable name of JDBC Request).Database URL : [jdbc]:[database type]://[hostname:

    port]/[database name]i.e.

    jdbc:mysql://127.0.0.1:8080/application.

    JDBC Driver class: com.mysql.jdbc.DriverUsername: root ( Default user name of MySql)

    Password: mysql (Default password of MySql)

  • 8/14/2019 Jmeter Day3 Satya

    12/41

    Simple JDBC Result

  • 8/14/2019 Jmeter Day3 Satya

    13/41

    Web-Service

    What is a Web Service?

    Web Service is a software system designed to support

    interoperable Machine to Machine interaction over a

    Network.

    It is based on already existing and well-known HTTP

    protocol.

    It refers to clients and servers that communicate using

    XML messages that follow the SOAP standard.

  • 8/14/2019 Jmeter Day3 Satya

    14/41

    Web-Service(SOAP)Request

    Pre-Requisites:

    The sampler requires mail.jar and activation.jar. This is

    because Apache SOAP requires these libraries.

    An application server running behind.

    A Web Service deployed on the application server.

    A WSDL URL to test

  • 8/14/2019 Jmeter Day3 Satya

    15/41

    Process:i) Write the functionality in java (or any other)

    ii) Write build file in xml

    iii) Start application server (JBoss).

    iv) Deploy java files using ant

    v) Web service created successfullyvi) Send SOAP request

    vii) Receive SOAP response

    Note:

    Here is a Calculator Web service deployed in JBoss Appserver,with methods add() and subtract () is being tested usingJMETER. We use Jmeter to send the SOAP request, themethods of Web service in the Appserver process the SOAPrequest and response obtained is seen in JMETER.

  • 8/14/2019 Jmeter Day3 Satya

    16/41

    SOAP Sampler

    a) Go to JBoss run.bat file to start the application server.

    In the Internet Explorer type :

    http://localhost:8080 to view the home page of JBoss.http://localhost:8080/jbossws/services to view list of web-

    services.

    b)In Jmeter go to:

    Thread Group->Add->Sampler->Web Service (SOAP)Request to add Sampler.

    c)Copy the URL into WSDL URL column of JMETER and

    press Load WSDL.

  • 8/14/2019 Jmeter Day3 Satya

    17/41

    SOAP Request Schema:

    invoking subtract method

    5000 arguments passed

    3000

  • 8/14/2019 Jmeter Day3 Satya

    18/41

    SOAP Response Schema:

    2000 SOAP response

  • 8/14/2019 Jmeter Day3 Satya

    19/41

    Simple SOAP Result

  • 8/14/2019 Jmeter Day3 Satya

    20/41

    LDAP The Lightweight Directory Access Protocol, or LDAP is an

    application protocol for querying and modifying directory

    services running over TCP/IP.

    A client starts an LDAP session by connecting to an LDAP

    server, by default on TCP port 389. The client then sends anoperation request to the server, and the server sends responses

    in turn.

    Examples:

    Centralized up-to-date phone book in an organization. Printers connected over network.

  • 8/14/2019 Jmeter Day3 Satya

    21/41

    There are four test scenarios of testing LDAP.

    Add Test

    This will add a pre-defined entry in the LDAP Server and calculate theexecution time.

    Modify Test

    This will create a pre-defined entry first, then will modify the created entry

    in the LDAP Server. And calculate the execution time.

    Search Test

    This will create the entry first, then will search if the attributes are

    available. It calculates the execution time of the search query..

    Delete Test

    This will create a pre-defined entry first, then it will be deleted from theLDAP Server. The execution time is calculated.

  • 8/14/2019 Jmeter Day3 Satya

    22/41

    ListenersA listener is a component that shows the results of the samples.

    The results can be shown in the form of a tree, tables, graphs

    or simply written to a log file.

    Types of listeners:

    Graph Results

    View Results Tree

    View Results in a Table

    Summary Report

    Aggregate Graph

    Aggregate Report

  • 8/14/2019 Jmeter Day3 Satya

    23/41

    Graph Results listener:

    It generates a simple graph that plots all sample times. The

    throughput number represents actual number of

    requests/minute the server handled + delays added to test and

    JMeter's own internal processing time.

    It includes:

    Data - plot the actual data values

    Average - plot the Average Median - plot the Median (midway value)

    Deviation - plot the Standard Deviation

    Throughput - plot the number of samples per unit of time

  • 8/14/2019 Jmeter Day3 Satya

    24/41

    Graph Results

  • 8/14/2019 Jmeter Day3 Satya

    25/41

    View Results Tree:

    It is a tree of all sample responses, the time a sample took toget this response and some response codes.

    Request panel only shows the headers added by Jmeter.

    View Results in a Table:

    This visualizer creates a row for every sample result.

    Summary Report:The summary report creates a table row for each differently

    named requestin your test. This is similar to the Aggregate

    Graph, except that it uses less memory.

  • 8/14/2019 Jmeter Day3 Satya

    26/41

    View Results Tree:

  • 8/14/2019 Jmeter Day3 Satya

    27/41

    View Results In a Table:

  • 8/14/2019 Jmeter Day3 Satya

    28/41

    Summary Report:

  • 8/14/2019 Jmeter Day3 Satya

    29/41

    Aggregate report :

    Creates a table row for each differently named request in the

    test. For each request, it totals the response information and

    provides request count, min, max, average, error rate,

    approximate throughput (request/second) and Kilobytes per

    second throughput.

    Aggregate graph :

    Is similar to the aggregate report and provides an easy way togenerate bar graphs and save the graph.

  • 8/14/2019 Jmeter Day3 Satya

    30/41

    Aggregate Report

  • 8/14/2019 Jmeter Day3 Satya

    31/41

    Aggregate Graph

  • 8/14/2019 Jmeter Day3 Satya

    32/41

    Results and AnalysisFactors involved:

    Throughput

    Response Time Latency

    Tuning

    Benchmarking

    Capacity Planning

  • 8/14/2019 Jmeter Day3 Satya

    33/41

  • 8/14/2019 Jmeter Day3 Satya

    34/41

    Latency:

    Is the delay caused by the application ,Operating system and

    by the environment that are calculated separately.

    N1

    N4 N3

    Network Latency = N1+N2=N3+N4

    Product Latency = A1+A2+A3

    Actual Response Time=Network Latency + Product Latency

    clien

    t

    A1

    Web

    Serve

    r

    A3

    DataBase

    A2

    ServerInte

    rnet

  • 8/14/2019 Jmeter Day3 Satya

    35/41

    Tuning:

    Is a method by which product performance is enhanced by

    setting different values to the parameters of the Product ,O.S

    and other components.

    Benchmarking:Comparing various parameters of the product(e.g. response

    time , throughput etc) with those of competitive products.

    Capacity Planning:

    Exercise to find out what resources and configurations areneeded prior to installation or upgrade of the product.

  • 8/14/2019 Jmeter Day3 Satya

    36/41

  • 8/14/2019 Jmeter Day3 Satya

    37/41

    Mean:

    Sum of the samples divided by the number of samples.Performance numbers are to be reproducible. To ensure this,

    all performance tests are repeated multiple times and the

    average or mean is taken.

    Some special cases:

    a)Noise Removal and Re-plotting and re- calculating mean,

    standard deviation.

    b)Differentiating data that is coming from Cache and Server.

  • 8/14/2019 Jmeter Day3 Satya

    38/41

    Standard Deviation:

    Standard Deviation represents how much data varies from the

    mean.

    S.D shows how consistently are the performance numbers

    reproducible.

    90% Graph:

    Percentage of transactions that were performed with in a given

    time range.

    e.g. say if the graph shows 90 percentile against 4.5 sec means90 percentage of the times your transaction is served within 4.5

    sec.

  • 8/14/2019 Jmeter Day3 Satya

    39/41

    References:http://jakarta.apache.org/

    Download Jakarta 2.3.2 from

    http://jakarta.apache.org/site/news/news-2008- q2.html#20080614.1.

  • 8/14/2019 Jmeter Day3 Satya

    40/41

    Queries?

  • 8/14/2019 Jmeter Day3 Satya

    41/41