Posted

6 minutes read

Overview

We are going to present how to use Apache JMeter (open source load testing tool) in order to perform basic load and stress testing on your web application. We are going through each step and show how to use JMeter’s GUI (graphical user interface) in order to build a test plan, configure load tests, run test and inspect the results.

Apache JMeter is an open source Java application, so it can run on any OS (operating system) which supports JAVA 6 or later. JMeter is a load testing (performance testing) tool designed to run tests on any given URI endpoint, with configurable number of concurrent clients (users) and other useful test configurable metrics and inspect results. Test results can be viewed in charts, tables or can be exported in CSV or XML formats.

Prerequisites

In order to start using JMeter you need a machine that you can install and run JMeter on. By default JMeter runs as a GUI application, which requires more resources than a command line based application. In order to perform the load tests faster and without bottlenecks you can run JMeter in the non-graphical mode (details on how to start JMeter in non-graphical mode in the next post)
Please note that results can differ based on the web server where the web application is hosted. Factors that we need to take into account are:

  • system resources CPU, RAM Memory of the web server
  • system resources CPU, RAM Memory of the machine where JMeter is installed (from where the tests are executed)
  • location of the web server between the load test injector and the web server where the application is hosted (which affects the latency of the tests – use a cloud load testing tool in order to easily run load tests from different locations)

Install JMeter

Apache JMeter is very easy to install. Depending on the OS, there are different ways on how to do this.

In order to run JMeter, here is what you need to install:

Make sure that after installing JAVA you add it to the $PATH environment variable. Here you can find how to add the JAVA to the $PATH environment variable for every OS .

To start JMeter on Windows OS you need to go to the folder where you unarchived JMeter binaries and just run $JMETER_HOME/bin/jmeter.bat batch file. Please see here how you can run JMeter on Mac.

So, once all is installed and JMeter is running you can start creating your first load test. For this demo we are going to use Apache JMeter 2.11 on Mac.

Build Test Plan

In order to create a load test, add a Thread Group, in order to configure the thread properties (load test configuration):

apache jmeter test plan

Start by adding a Thread Group to your Test Plan by following the below steps:

  • Select the Test Plan on the left side, and Right-click it
  • Hover to Add -> Threads (Users) -> Thread Group
  • Click on Thread Group
apache jmeter thread group

Configure the following properties which will be used to run your load test:

In order to run load tests with thousands of threads (users) and to run load tests from different world locations, you can use LoadFocus.com which offers a cloud load testing service, easy to use, which keeps all your tests and test runs in the history automatically.


Thanks for reading. I hope you learned something interesting about React!
If you found this article useful, please share it with others. Don’t forget to subscribe to get notified for the upcoming articles.