Using JMeter to Performance Test Web Services

by Dmitri Nevedrov
08/02/2006

Abstract

Performance testing is an important part of any distributed or Web application testing plan. Inclusion of performance estimates into planning and development cycles ensures that the application delivered to a customer satisfies high load, availability and scalability requirements. Early identification of software load limitations helps to configure the system appropriately to avoid unexpected crashes. Several questions should be addressed at system performance analysis: will the system or server be able to process simultaneous requests coming from hundreds, or thousands of clients, and, what is the frequency of requests the system can handle. This type of test not only provides an absolute measure of system response time, but also targets the regressions on server and application code, examines if the response from the server matches the expected result, and helps to evaluate and compare middleware solutions from different vendors.

Apache JMeter—a performance testing framework from Apache, has been widely accepted as a performance testing tool for Web applications. It can be used to analyze overall server performance under simulated heavy load. The software features FTP and HTTP requests and extensible custom scripting features. In this article we show how JMeter can be used to load test Web services. In particular we demonstrate it by deploying a simple Web service on BEA WebLogic Server 9.0. The example test plan illustrates the creation of a test plan, thread group, loop, and a Web service request. We also discuss how to measure the data and interpret results displayed on graphical tools provided with JMeter chart.

JMeter

Apache JMeter is a tool that can be used to test applications utilizing HTTP or FTP servers. It is Java based and is highly extensible through a provided API. A typical JMeter test involves creating a loop and a thread group. The loop simulates sequential requests to the server with a preset delay. A thread group is designed to simulate a concurrent load. JMeter provides a user interface. It also exposes an API that allows you to run JMeter-based tests from a Java application. To create a load test in JMeter build a test plan, which is essentially a sequence of operations JMeter will execute. The simplest test plan normally includes the following elements:

  • Thread group - These elements are used to specify number of running threads and a ramp-up period. Each thread simulates a user and the ramp-up period specifies the time to create all the threads. For example with 5 threads and 10 seconds of ramp-up time, it will take 2 seconds between each thread creation. The loop count defines the running time for a thread. The scheduler also allows you to set the start and end of the run time.
  • Samplers - These elements are configurable requests to the server HTTP, FTP, or LDAP requests. This tutorial focuses on the Web service requests only.
  • Listeners - These elements are used to post process request data. For example, you can save data to a file or illustrate the results with a chart. At the moment the JMeter chart does not provide many configuration options; however it is extensible and it is always possible to add an extra visualization or data processing module.

A more detailed description of the available elements is given on the Apache JMeter Web site. In some cases, when the available elements are not suitable for a particular test, a developer can write his or her own script or Java class and embed it into a test plan by placing a jar file into the JMeter installation \lib\ext\ directory.

In this article we use JMeter version 2.1. Download a binary executable from the Web site, unzip it, and the application is ready for use on Windows or Unix platforms. Go to the bin folder and start the application with jmeter.bat or jmeterw.bat if you work on the Windows operating system. The initial user interface is shown in Figure 1.

Figure 1
Figure 1. Starting Apache JMeter

Pages: 1, 2, 3, 4, 5

Next Page »