1

JMeter Performance Testing

Habtamu Petros

Last Update il y a 4 ans

JMeter Performance Testing is a testing method performed using Apache JMeter to test the performance of a web application. JMeter for performance testing helps to test both static and dynamic resources, helps to discover concurrent users on the website, and provides a variety of

graphical analyses for performance testing. 

JMeter Performance Testing includes:

  • Load Testing: Modeling the expected usage by simulating multiple users accessing the Web services concurrently.
  • Stress Testing: Every web server has a maximum load capacity. When the load goes beyond the limit, the web server starts responding slowly and produces errors. The purpose of Stress Testing is to find the maximum load the web server can handle.

Steps to Create a Performance Test Plan in JMeter

Step 1) Add Thread Group

In this Lab manual, we are doing a performance analysis of a craft online shopping web application for 2500 users

  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

In the Thread Group control panel, enter Thread Properties as follows:

  • Number of Threads: 50 (Number of users connecting to the target website: 50)
  • Loop Count: 50 (Number of times to execute testing)
  • Ramp-Up Period: 50

The Thread Count and The Loop Counts are different.

  • Thread Count simulates 50 concurrent users connecting to the target website
  • Loop Count simulates one user connecting to the target website 50 times
  • Ramp-Up Period tells JMeter how long to delay before starting the next user. For example, if we have 50 users and a 50-second Ramp-Up period, then the delay between starting users would be 1 second (50 seconds /50 users)

Step 2) Adding JMeter elements

Now we determine what JMeter elements are 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.

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

(shop.icraftsoft.net

  • HTTP Request

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

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


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

request http://shop.icraftsoft.net:8095/register to craft shopping server.

If you keep the Path field blank JMeter will create the URL request www.shop.icraftsoft.net to craft an online shopping server.

Step 3) Adding Graph result

JMeter can show the test result in Graph format.

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

Step 4) Run Test and get the test result

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


The picture below presents a graph of a test plan, where we simulated 50 users who accessed on website www.shop.icraftsoft.net.

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 (quantifies how much response time varies around).

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

Was this article helpful?

1 out of 1 liked this article