Using JMeter. Installing and Running JMeter. by Budi Kurniawan 01/15/2003

Similar documents
jmeter is an open source testing software. It is 100% pure Java application for load and performance testing.

Introduction Installation and Startup JMeter GUI

Plone Performance Testing Documentation

Guide to Install J Meter

JMETER - TEST PLAN ELEMENTS

Prepared by JMeter Group, Summer Interns

This tutorial will teach you how to use Java Servlets to develop your web based applications in simple and easy steps.

Application Development in JAVA. Data Types, Variable, Comments & Operators. Part I: Core Java (J2SE) Getting Started

Converting JMeter HTTP(S) Tests and SOAP/XML-RPC Tests to Apica ProxySniffer

EUSurvey OSS Installation Guide

LOADRUNNER INTERVIEW QUESTIONS

AN INTRODUCTION TO PERFORMANCE TESTING USING JMETER

Parallel Tools Platform for Judge

Securing Apache Tomcat. AppSec DC November The OWASP Foundation

Struts Design And Programming: A Tutorial (A Tutorial Series) By Budi Kurniawan READ ONLINE

CSSE 460 Computer Networks Group Projects: Implement a Simple HTTP Web Proxy

For those who might be worried about the down time during Lync Mobility deployment, No there is no down time required

Monitoring Apache Tomcat Servers With Nagios XI

Java Applets, etc. Instructor: Dmitri A. Gusev. Fall Lecture 25, December 5, CS 502: Computers and Communications Technology

CS506 today quiz solved by eagle_eye and naeem latif.mcs. All are sloved 99% but b carefull before submitting ur own quiz tc Remember us in ur prayerz

About the Authors. Who Should Read This Book. How This Book Is Organized

Aim behind client server architecture Characteristics of client and server Types of architectures

Architecting ArcGIS Server Solutions for Linux and Solaris

Secure/Non-secure page redirector documentation

Software Elements of Electronic Business Sites

Repository In A Box (RIB)

Windows Installation. Step 1 Download and run the current Jedox Setup file for Windows. Select the language for installation:

EUSurvey Installation Guide

Hackveda Appsec Labs Java Programming Course and Internship Program Description:

SiteProxy adds security, reduces network traffic on the camera, and improves performance.

COURSE DETAILS: CORE AND ADVANCE JAVA Core Java

Troubleshooting Single Sign-On

Purpose. Why use Java? Installing the Software. Java

Troubleshooting Single Sign-On

Georgia Department of Education

Phpmyadmin Error In Processing Request Error Code 200

Loops. In Example 1, we have a Person class, that counts the number of Person objects constructed.

Servlet Performance and Apache JServ

At the Forge. What Is Ruby? Getting Started with Ruby. Reuven M. Lerner. Abstract

The Basic Web Server CGI. CGI: Illustration. Web based Applications, Tomcat and Servlets - Lab 3 - CMPUT 391 Database Management Systems 4

Install and Run Multiple Tomcat and JAVA server instances on single Windows server Howto

Apache Tomcat Installation guide step by step on windows

Badboy v2.1 User Documentation

DOWNLOAD OR READ : UBUNTU I IN YOU AND YOU IN ME PDF EBOOK EPUB MOBI

Computer Networks - A Simple HTTP proxy -

COSC 2206 Internet Tools. The HTTP Protocol

MySQL SERVER INSTALLATION, CONFIGURATION, AND HOW TO USE WITH STARCODE NETWORK

Administration Manual

SOFTWARE PERFORMANCE TESTING TIPS WITH JMETER

Web Browser Application Troubleshooting Guide. Table of Contents

Manually Run Java Update Windows 7 Registry

FITECH FITNESS TECHNOLOGY

New Cycle Manager operation

WebDirect Configuration Guide

Detects Potential Problems. Customizable Data Columns. Support for International Characters

CA SiteMinder Federation Security Services

Using Doxygen to Create Xcode Documentation Sets

QMShibb - Shibboleth enabling Questionmark Perception

Enterprise JavaBeans. Layer:01. Overview

Administration Manual

Setting Up the Development Environment

SecurityAndNetworking

Reset the Admin Password with the ExtraHop Rescue CD

Dynamic Documents. Kent State University Dept. of Math & Computer Science. CS 4/55231 Internet Engineering. What is a Script?

The exam. The exam. The exam 10. Sitting a City & Guilds online examination 11. Frequently asked questions 18. Exam content 20

Nolij Transfer 6 Migration Planning & Preparation. Danielle Whitney Services Product Manager

Title Unknown Annapurna Valluri

Thunderbird POP Instructions Bloomsburg University Students

CGI Architecture Diagram. Web browser takes response from web server and displays either the received file or error message.

Performance implication of elliptic curve TLS

JAVA Training Overview (For Demo Classes Call Us )

Web Application Architecture (based J2EE 1.4 Tutorial)

Top Ten Tips for Getting Started with PHP

Application Notes for INI EQuilibrium TM with Avaya Voice Portal Issue 1.0

Improve Web Application Performance with Zend Platform

Enterprise Architect. User Guide Series. Profiling. Author: Sparx Systems. Date: 10/05/2018. Version: 1.0 CREATED WITH

ENTRUST CONNECTOR Installation and Configuration Guide Version April 21, 2017

ELECTRONIC LOGBOOK BY USING THE HYPERTEXT PREPROCESSOR

Enterprise Architect. User Guide Series. Profiling

OO Based Development of a Multi Media Application Server Prototype

Upgrade Instructions. NetBrain Integrated Edition 7.1. Two-Server Deployment

COPYRIGHTED MATERIAL

Linksys WRT54G v5.0 & 5.1 & 6.0

HttpServlet ( Class ) -- we will extend this class to handle GET / PUT HTTP requests

OpenWrtDocs/Installing

Can HTTP Strict Transport Security Meaningfully Help Secure the Web? nicolle neulist June 2, 2012 Security B-Sides Detroit

Shell Script Not Running Via Cron Runs Fine Manually

IBM Home Products Consulting Industries News About IBM Search

WA2031 WebSphere Application Server 8.0 Administration on Windows. Student Labs. Web Age Solutions Inc. Copyright 2012 Web Age Solutions Inc.

Persistence & State. SWE 432, Fall 2016 Design and Implementation of Software for the Web

Windchill Read This First Windchill 9.1 M August 2010

How To Start Mysql Using Linux Command Line Client In Ubuntu

UNI CS 3470 Networking Project 5: Using Wireshark to Analyze Packet Traces 12

Java For The Web With Servlets, JSP, And EJB: A Developer's Guide To J2EE Solutions: A Developer's Guide To Scalable Solutions.

The Application Layer HTTP and FTP

Web Hosting. Important features to consider

Entrust Connector (econnector) Venafi Trust Protection Platform

GUJARAT TECHNOLOGICAL UNIVERSITY

Apica ZebraTester. Advanced Load Testing Tool and Cloud Platform

Cisco Unified Serviceability

Transcription:

1 of 8 7/26/2007 3:35 PM Published on ONJava.com (http://www.onjava.com/) http://www.onjava.com/pub/a/onjava/2003/01/15/jmeter.html See this if you're having trouble printing code examples Using JMeter by Budi Kurniawan 01/15/2003 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. Installing and Running JMeter 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.

2 of 8 7/26/2007 3:35 PM 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: 1. 2. You should not run JMeter on the same machine running the application to be tested. JMeter may use extensive resources that might affect the other application's performance if they are both run on the same machine. Make sure that the testing is affected as little as possible by network traffic. The best thing to do is to ask your network administrator to set up an isolated sub-network for the machine running the Web application and the machine running JMeter. Using JMeter for a Simple Test 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.

3 of 8 7/26/2007 3:35 PM In this page, you can set the following properties: Name -- the name of this thread group. You can give a descriptive name to this property. Number of Threads -- the number of threads created. Each thread represents a single user. Therefore, if you want to simulate a load test with 10 concurrent users, enter 10 as the value for this property. Ramp-Up Period -- the number of seconds JMeter will take to accelerate to create all of the threads needed. If the number of threads used is 10 and the ramp-up period is 20 seconds, JMeter will take 20 seconds to create those 10 threads, creating one new thread every two seconds. If you want all threads to be created at once, put 0 in this box. Forever -- if clicked, this option tells JMeter to keep sending requests to the tested application indefinitely. If disabled, JMeter will repeat the test for the number of times entered in the Loop Count box. Loop Count --this property value only has an effect if the Forever check box is unchecked. It tells JMeter the number of times it has to repeat the test. 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.

4 of 8 7/26/2007 3:35 PM 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. Name -- the name of this HTTP request. The name should be descriptive; remember that it is common to have multiple HTTP Request elements in a thread group. Server Name or IP -- the server name or the IP address of the machine running the application being tested. Port Number -- the port number used by the application. Normally, a Web application runs on port 80. Protocol -- the protocol used, either HTTP or HTTPS. Method -- the request method, either GET or POST. Path -- the path to the resource that will handle this request. Follow Redirects -- follows redirections sent by the Web application, if any. Use KeepAlive -- if checked, sends the 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. Parameters -- the list of parameters sent with this request. Use the Add and Delete buttons to add and remove parameters. Send a file with a request -- simulate a file upload to the Web application. Retrieve all images and Java Applets -- download embedded content. Now you should be able to figure out the values for the properties in the HTTP Request page. The last element that we need to add to our test plan is a listener, which in JMeter is the same as a report. JMeter comes with various reports to choose from. A report can be a table or a graph. For this testing, use the easiest report available: a table. To add a listener, right-click the Thread Group element, select Add, and then Listener and View Results in Table. Now you are ready to run the test plan. Before you run your test plan, however, you are advised to save the test plan just in case JMeter crashes the system (an occasional occurrence with higher numbers of threads and loop counts). Afterwards, select Start from the Run menu to execute the test plan. While the test plan executes, the small box on the bar right below the menu bar will turn green. For a test that does not run indefinitely, JMeter will automatically stop the test plan after it's finished. For a test that goes on indefinitely, you must intervene to stop the test. Do this by selecting Stop from the Run menu. When I ran my test plan, I got the results like those shown in Figure 4.

5 of 8 7/26/2007 3:35 PM Figure 4: A table report. It is very easy to understand the figures in the table. There are six samples taken (two threads and three loop counts, thus 2 x 3 = 6). The response time from each sample is given in the third column. They are 100, 60, 260, 50, 120, and 80 ms. All samples are taken successfully, as described by the fourth column. On average, each sample has a response time of 111 ms ((100 + 60 + 260 + 50 + 120 + 80)/6). Another important figure is the standard deviation, defined as the square root of the total of the deviation of each sample from the average. This figure indicates how stable your Web application is. If the standard deviation is high, some users will experience very good responses while some other users will wait for a longer time. The smaller this value, the better. After conducting a simple test, it is very easy to do more complex tests. For load testing Web applications, increase the number of threads and the loop counts gradually and see how your applications cope with the loads. The following sections of this article tackle some other important aspects of load-testing Web applications with JMeter. Listeners JMeter comes with a number of listeners or reports. In the previous test, we used a table to display the test results. If this is not suitable for you, you can choose one or more of the other listeners for a thread group. A popular listener is the Graph Results, as shown in Figure 5.

6 of 8 7/26/2007 3:35 PM Figure 5: Graph results. Multiple HTTP Requests A real application has multiple resources, both static and dynamic. Chances are, you want to see the performance of these resources. JMeter makes it easy to employ multiple HTTP requests. Just add any number of HTTP Request elements and configure them, as in the previous test. If you have multiple HTTP Request elements, you might want to use a HTTP Request Defaults element, described in the following section. HTTP Request Defaults The HTTP Request Defaults element specifies the default values of existing HTTP Request elements within the same thread group. The HTTP Request Defaults element is especially useful because most, if not all, HTTP Request elements normally have the same server and port. Figure 6 shows the detail page of a HTTP Request Defaults element.

7 of 8 7/26/2007 3:35 PM Figure 6: HTTP request defaults. Add an HTTP Request Default element by right-clicking a Thread Group element and then selecting Add, Config Element, and HTTP Request Default. Cookie Manager Many Web applications use cookies. JMeter provides cookie capabilities through a Cookie Manager. Adding this element to a thread group allows you to send cookies to the application being tested, just as Web browsers do. Figure 7 displays the details page of a Cookie Manager. Here you can add and delete a cookie. Figure 7; Cookie Manager. You can add a Cookie Manager element by right-clicking a Thread Group element and then selecting Add,

8 of 8 7/26/2007 3:35 PM Config Element, and Cookie Manager. Summary JMeter is capable of much more than our simple tests demonstrate. From these building blocks, it's possible to create extensive tests with highly detailed reports. Getting useful results is very easy, though. For more information, see the JMeter User Manual. Budi Kurniawan is a senior J2EE architect and author. Return to ONJava.com. Copyright 2007 O'Reilly Media, Inc.