| Sign In/My Account | View Cart |
JMeter is a Java-based tool for load testing client-server applications. Stefano Mazzocchi originally wrote it to test the performance of Apache JServ (the predecessor of Jakarta Tomcat). It has since become a subproject of Jakarta.
The most recent release of JMeter is version 1.8. You can download the latest stable version
from JMeter's site.
Downloads area available as either .gz or .zip files.
JMeter 1.8 requires a working JDK 1.4 environment.
Once you extract the binary distribution file, JMeter is ready for you. On
Linux/UNIX, run JMeter by invoking the jmeter shell script. On
Windows, call the jmeter.bat file. Both files can be found in the
bin/ directory of the JMeter installation directory. Figure 1 shows
JMeter's main window, which is a Swing application.

Figure 1: JMeter's main window.
The user interface has two panes. The left pane displays the elements used in our testing. Initially, there are the Root and two sub-elements, Test Plan and WorkBench. In this article we're only concerned with Test Plans. Add an element to a node by right-clicking it and selecting Add. To remove an element, select the element by clicking on it, then right-click on the element and choose the Remove option.
The right pane of the user interface displays the details of each element. You are now ready to use JMeter. There are two things to note:
Let's start with a very simple test. In this test, we will set up a test plan and stress test a Web application. You will be introduced with some common concepts in JMeter. After understanding this basic test, you should be able to use all of the capabilities of JMeter.
To conduct a test, you must have a test plan. A test plan describes the steps that JMeter will take to perform the testing. A test plan includes elements such as thread groups, logic controllers, sample generating controllers, listeners, timers, assertions, and configuration elements. Don't worry at this stage if you don't understand what these elements are.
A test plan must have at least one thread group. A thread group is the starting point of a test plan, and it can contain all other JMeter elements. A thread group controls the threads that will be created by JMeter to simulate simultaneous users.
Now, let's start by creating a thread group. Right-click the Test Plan element and select Add and then Thread Group. JMeter will create a thread group element under Test Plan element. Click the Thread Group element, and you will see a screen like the one in Figure 2.

Figure 2: Configuring a thread group.
In this page, you can set the following properties:
For our simple test, fill the properties with the values found in Figure 2. We will use two users and each test will be performed three times. We use small numbers here so that we can easily explain the results later; in real load testing, you might want to use higher numbers for these properties.
Next, you need to add the element that represents HTTP requests. To do so, right-click the Thread Group element, and select Add, Sampler, and then HTTP Request. An HTTP Request element will be added to the Thread Group element. Click the HTTP Request element to select it, and you should see a screen similar to Figure 3.

Figure 3: Configuring an HTTP Request element.
On the HTTP Request screen, you configure the HTTP requests that will be used to "hit" your application. Here, you can set the following properties.
Connection =
Keep-Alive request header. By default, an HTTP 1.1 browser uses
Keep-Alive as the value of the Connection header. Therefore, this checkbox
should be checked.Pages: 1, 2 |