Mutiara Hana
May 23, 2018 · 5 min read

Find out about JMeter, here

Performance Testing is crucial to determine that the web application under test will satisfy high load requirements. It can be used to analyze overall server performance under heavy load.

JMeter testing tool offers following benefit in Performance Testing:

  • JMeter can be used to test performance of both static resources such as JavaScript and HTML, as well as dynamic resources, such as JSP, Servlets, and AJAX.
  • JMeter can discover maximum number of concurrent users that your website can handle
  • JMeter provides a variety of graphical analyses of performance reports.

Create a Performance Test Plan in Jmeter

Before testing the performance of target web application, we should determine-

  • Normal Load: Average number of users visit your website
  • Heavy Load: The maximum number of users visit your website

Here is the roadmap of this practical example

The how-to step

Step 1) Add Thread Group

  1. Start JMeter
  2. Select Test Plan on the tree
  3. Add Thread Group

Right click on the Test Plan and add a new thread group: Add -> Threads (Users) -> Thread Group

Step 1

In Thread Group control panel, enter Thread Properties as following:

Step 1.1
  • 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

The Thread Count and The Loop Counts are different.

Ramp-Up Period tells JMeter how long to delay before starting next user. For example, if we have 100 users and a 100 second Ramp-Up period, then the delay between starting users would be 1 second (100 users /100 seconds)

Step 2) Adding JMeter elements

Now we determine what JMeter elements in this test. The elements are

HTTP request Default

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

Step 2

In the HTTP Request Defaults control panel, enter the Website name under test (http://www.google.com)

Step 2.1

HTTP Request

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

Step 2.3

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

Step 2.4

For example, if you enter “calendar” in Path field. JMeter will create the URL request http://www.google.com/calendar to Google server

Step 2.5

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

In this test, you keep the Path field blank to make JMeter create the URL request http://www.google.com to Google server.

Step 3) Adding Graph result

JMeter can show the test result in Graph format.

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

Step 3

Step 4) Run Test and get the test result

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

The picture below presents a graph of a test plan, where we simulated 100 users who accessed on website www.google.com.

Step 4

At the bottom of the picture, there are the following statistics, represented in colors:

  • 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

Let analyze the performance of Google server in below figure.

Step 4.1

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.

In this test, the throughput of Google server is 1,491.193/minute. It means Google server can handle 1,491.193 requests per minute. This value is quiet high so we can conclude that Google server has good performance

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

NOTE: The above values depend on several factors like current server load at google , your internet speed, your CPU power etc. Hence, it’s very unlikely that you will get the same results as above. So don’t panic!

Troubleshooting:

If you face the issue while running the above scenario … do the following

  1. Check whether you are connecting to internet via a proxy. If yes, remove the proxy.
  2. Open a new instance of Jmeter
  3. Open the PerformanceTestPlan.jmx in Jmeter
  4. Double Click on Thread Group -> Graph Result
  5. Run the Test

SkyshiDigital

We help scale up your startup to the next level

Mutiara Hana

Written by

SkyshiDigital

We help scale up your startup to the next level

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade