CYBOSOL InfoTech

JMeter for beginners

What is J-Meter?

Apache JMeter is open source software, a 100% pure Java desktop application, designed to load test functional behavior and measure performance of web sites. It was originally designed for load testing web applications but has since expanded to other test functions.

What is Load and Stress Testing?

Load Testing: Modeling the expected usage by simulating multiple user access the web services concurrently.

Stress Testing: Every web server has a maximum load capacity. When the load goes beyond the limit, the web server start responding slowly and produces errors. The purpose of the stress testing is to find the maximum load the web server can handle.

How J-Meter Works?

1

Hands on with J-Meter GUI

As soon as you launch J Meter, you will see 2 elements

  • Test Plan
  • Workbench
2

How can we test a simple project?

Test Plan is where you add elements required for your J Meter Test.

Following figure shows an example of Test Plan

3

The WorkBench simply provides a place to store test elements temporarily.

4

Different steps for test plan creation.

Step 1) Add Thread Group

  • Start JMeter
  • Select Test Plan on the tree
  • Add Thread Group
  • Right click on the Test Plan and add a new thread group: Add -> Threads (Users) -> Thread Group
5 6

Number of Threads:100 (Number of users connects to target website: 100)

Loop Count: 10 (Number of time to execute testing)

Ramp-Up Period: 100

Step 2) Adding JMeter elements

This element can be added by right-clicking on the Thread Group and selecting: Add -> Config Element -> HTTP Request Defaults.

7

In the HTTP Request Defaults control panel, enter the Website name under test

8

HTTP Request

Right-click on Thread Group and select: Add -> Sampler -> HTTP Request.

9

In HTTP Request Control Panel, the Path field indicates which URL request you want to send to Google server.

In HTTP Request Control Panel, the Path field indicates which URL

10

For example, if you enter "calendar" in Path field. JMeter will create the URL request

Untitled-8

If you keep the Path field blank JMeter will create the URL request http://www.abc.com to server.

Step 3) Adding Graph result

JMeter can show the test result in Graph format.

Right click Test Plan, Add -> Listener -> Graph Results

12

Step 4) Run Test and get the test result

Press Run> button (Ctrl + R) on Toolbar to start the testing process. You will see the test result display on Graph at the real

13

Black: The total number of current samples sent.

Blue: The current average of all samples sent.

Red: The current standard deviation.

Green: Throughput rate that represents the number of requests per minute the server handled

To analyze the performance of the web server under test, you should focus on 2 parameters

  • Throughput
  • Deviation

The Throughput is the most important parameter. It represents the ability of the server to handle heavy load. The higher the Throughput is, the better is the server performance.

The deviation is shown in red - it indicates the deviation from the average. The smaller the better.

View Results in Table displays the test result in table format.

Right click Add -> Listener -> View Result in Table

14

View Results in Table displays as below figure

15

Run your test

16

Let compare the performance of Google server to other web server. This is the performance test result of website http://www.yahoo.com/ (You can choose other website)

17 18

The throughput of website under test http://www.yahoo.com is 867.326/minutes. It means this server handle 867.326 requests per minute, lower than Google.

The deviation is 2689, much higher than Google (577). So we can determine the performance of this website is less than Google server.