Introducing JMeter and configuring a simple test

Apache JMeter is an open source Java desktop application, built to verify functional behavior, perform load tests, and measure performance. Some of JMeter points of strength are mentioned here below:

  • It ships with an easy-to-use GUI
  • It allows to set up multiple thread groups, different parallelism and request count, to ramp up the load
  • It can use CSV files to generate semi-randomized requests
  • It can execute parameterized tests
  • It reports results in a simple table
  • It uses assertions for checking test results
  • It can be executed in batch

In the picture below we have summarised the basic concepts of a JMeter test which we are going to build right afterwards.


JMeter basic concepts

Configuring a simple test

This section explains how to run performance tests using JMeter in order to evaluate the GeoServer performances when serving WMS requests. The performance test aims to stress the server and evaluates the response time and throughput with an increasing number of simulated users sending concurrent requests to the server.


Ideally, to avoid adding extra load to the server JMeter should run on a different machine.


If you have performed the exercises in the security section, please go back to the layer and service security pages and open access to everybody, on all data and all services, before performing the exercises in this section

  1. From the training root, on the command line, run jmeter.bat (or if you’re on Linux) to start JMeter:


    jMeter interface

  2. Add a new Thread Group with the mouse right click on Test Plan tree node:


    Adding a new Thread Group

  3. In the Thread Group panel set the number of thread for the test to 4 (this represents the number of simultaneous requests that are made to GeoServer) and the ramp-up period to 60. Also, chek Forever on the Loop Count field.


    Setting the Thread Group

  4. Add a new Loop Controller with the mouse right click on Thread Group tree node:


    Adding a new Loop Controller

  5. Right click on the Loop Controller tree node and add a new HTTP Request element:


    Adding a new HTTP Request

  6. In the HTTP Request enter the following basic configuration:

    Field Value
    Server Name or IP localhost
    Port Number 8083
    Path geoserver/ows

    HTTP Request host/port/path configuration

  7. From the training data dir root, open the data/jmeter_data/jmeter_request_params.txt, select and copy its contents in the clipboard, then click “Add from Clipboard” in the “HTTP request” panel to setup a sample GetMap request:


HTTP parameters configuration

  1. Add the following listeners by right clicking on Test Plan tree node: View results Tree, Summary Report, Graph results


    Adding a Listeners

  2. Save this configuration into data/jmeter_data/ as jmeter_simple.jmx

At this point JMeter is configured to run a GeoServer performance test:

  1. Click on Run tool and select Start to startig the jMeter test.


    starting jMeter test

  2. Select View Results Tree to directly see the request informations produced and the request result:


    The View Results Tree panel

  3. Select Summary report to view the statistical informations about the requests:


    The Aggregate Graph panel

  4. Select Graph Results to analyze the technical trend of the requests:


    The Spline Visualizer panel

  5. Click on Run tool and select Stop to end the benchmarking session