CS490AM

Fall 2009

Performance and Stress Testing

JMeter

 

 

Overview

In this Lab, your team will use Apache JMeter,  a Java based application used to test performance of static and dynamic resources.  JMeter was originally developed to test the Apache server, but it has been extended to test various applications.  JMeter can simulate heavy loads on a server, multiple requests and provides a variety of reporting options, which can be used to analyze performance.

 

Tests in JMeter are designed using a GUI and are organized in a tree structure, that defines the hierarchies and order of operations.  A Test Plan  consists of the following elements:  ThreadGroup, Controller, Samplers, Listeners, Pre-Processors and Post-Processors.  By arranging the available elements and using appropriate parameters, you can run complex tests to find out about the performance of a server or application.

 

 

Exercise

Since the software is web-based, you can do this exercise from any computer.

 

PART A – Installation

 

1)     Download JMeter from the following Web-Site

             

              http://jakarta.apache.org/site/downloads/downloads_jmeter.cgi

 

              The installation is very simple: you just decompress the installation file in the directory where you want to run JMeter.  The only requirement is that your computer has a working version of Java with all the paths set correctly.

 

2)     Read the following section of the manual to familiarize yourself with JMeter:

 

       http://jakarta.apache.org/jmeter/usermanual/build-test-plan.html

 

             

3)     Start JMeter by running:  jmeter.bat in Windows or jmeter in Unix.  (both can be found in the bin directory of your installation).

 

4)     The User guide for JMeter is available at:

 

       http://jakarta.apache.org/jmeter/usermanual/index.html

 

5) A small square in the upper right corner of JMeter turns green when the tests are running and grey when they have been completed.

 

 

PART B – Basic tests to http servers

 

1)     Add a Thread Group with 100 threads, Loop Count of 2, and a Ramp-Up period of 5 seconds to a new Test Plan

2)     Add a http sampler to your Thread Group and use www.google.com as the server name

3)     Add a Graph Results and View Results in a Table listeners to your test

4)     Run the test

5)     Save the results to a file

 

Repeat the tests for the following sites:

a)     www.yahoo.com

b)     www.purdue.edu

c)     www.tcpl.lib.in.us/

d)     www.wlaf.lib.in.us/

 

6) Produce a summary report showing the statistics for each site (Site name vs. average statistics).

 

 

PART C – Performance of http servers with different loads

1)     Add a Thread Group with 100 threads and a Ramp-Up period of 5 seconds to a new Test Plan (Use Loop Count 1)

2)     Add a Timer (Constant) of 300 ms

3)     Add a http sampler to your Thread Group and use www.google.com as the server name

4)     Repeat the experiments for the following web-sites:

 

a)     www.google.com

b)     www.google.com.ar/

c)     www.google.cn/

 

5)     For each web-site, repeat the experiments using the following number of threads

      

a)     1000

b)     3000

c)     5000

d)     7000

e)     10000

 

6)     Make a summary graph that plots number of threads versus average performance (ms) for each site (On the x-axis, put the number of threads, on the Y-axis the time.  Then draw one curve for each url.)

 

PART D – Performance using parameters

 

 

1)   Add a Thread Group with 1000 threads and a Ramp-Up period of 5 seconds to a new Test Plan

2)   Add a timer of 300 ms

3)     Add a http sampler to your Thread Group and use search.yahoo.com as the server name

4)     Repeat the experiments for the following web-sites:

5)  For the path use: search.  Add a parameter name: p  with value: computer  (The http request will be:

      http://search.yahoo.com/search?q=computer)

6) Repeat the test for these web-sites

a)     de.search.yahoo.com

b)     ar.search.yahoo.com  

c)     in.search.yahoo.com   

 

5)     For each web-site, repeat the experiments using the following parameter value:

      

a)     ambidextrous

b)     news

c)     endian

d)     wunderbar

e)     pibe

 

6)     Make a summary graph that plots search terms versus average performance (ms) for each site (On the x-axis, put the urls.  On the y-axis, put the time (ms).  Then plot one curve for each parameter value).

 

PART E – Basic tests to ftp servers

 

1)     Add a Thread Group with 5 threads, Ramp-Up period of 0 seconds and Loop Count of 1, to a new Test Plan

2)     Add a FTP Request Defaults (available from the Config Elements submenu) to your Thread Group and use ftp.purdue.edu as the server name, name it FTP Purdue Default

3)     Add a ftp request, leave the Server Name blank and enter in the File To Retrieve from Server field:  /pub/eas/test.txt

       For user name and password, enter : anonymous (in both fields)

4)     Add a Spline Visualizer listener to your test

5)     Run the test

6)     Save the results to a file, compare the performance with http requests.

7)     Repeat the test with 20 threads.  What is the performance ?