| JMeter Load TestingThis contains an analysis of JMeter, the popular open-source Java-based tool for load testing, in contrast with LoadRunner (which precedes it). This page aims to succintly describe how to install, configure, and use JMeter on Windows, minus the attitude and sales generalizations. See related pages on load testing tools, Testing | Topics this page: |
|
JMeter's home page is jemeter.apache.org. [ Wikipedia]
Like other software used to conduct load and stress testing, JMeter (like LoadRunner wire protocols) emulates what goes over the wire in and out between a browser and the server under test.
JMeter is able to record traffic in native WinInet protocol as well as HTTP protocol, which may explain why OpenSTA response times stats vary from LoadRunner and JMeter for the same app/machine
Unlike commercial software such as LoadRunner, JMeter is built by a open-source community of unpaid volunteers. It was available from Dec. 2003 until 2011 at http://jakarta.apache.org/jmeter as a sub-project supported by the Apache SoftwareFoundation (ASF).
The trend of jobs by posting aggregator Indeed.com dynamically calculates the trend of jobs posted for JMeter vs. LoadRunner since 2005.
The trend is that around 2014, more JMeter jobs were posted than LoadRunner jobs. THe extrapolation is for no LoadRunner jobs by 2015.
Over the years, that spread has widened.
When placed side-by-side, Google's search stats by country (as of July 15, 2014) reveals differences by country:
Despite state-imposed limitations on use of Google search, more people from China (perhaps using proxy servers) used Google to search for LoadRunner than even India, where legions of outsourcing employees live. So interest in China must be much larger than indicated. That's not hard to imagine because 9 of the top 25 websites in the world are for China. Alibaba.com has more business than Amazon and EBay combined.
Curiously, search for JMeter in China is only a third of interest in India.
Yet HP seems to be investing most of its LoadRunner marketing efforts in the US,
when the United States account of just 17% of what China has.
Click on "View Changes over time" control on the Google page and
note that interest from China surged to the top during the 2nd half of 2013.
The disparity of general population size versus interest in JMeter is strongest in Japan, and not on the LoadRunner country list at all.
The Ohloh website by Black Duck tracks contributions to JMeter core.
JMeter's maintainers include Mike Stover
and
others active on the
JMeter Mailing List. This group is the one issuing Twitter feed
@ApacheJMeter.
The main contributor to JMeter core (since 2004) is Sebastian Bazley (sebb), a VP of the Apache Software Foundation.
Philippe Mouawad (@pmouawad) works in France at ubik-ingenierie.com (@ubikloadpack) which sells UBIK Load Pack Productivity extensions for Apache JMeter to load test GWT / GWT-RPC, AMF / FLEX, Applets and Spring. It answers many questions on Stackoverflow about JMeter.
While BlazeMeter is one of the sponsors,
Atlanbh is among the most prolific of acknowledged contributors to
Custom JMeter Plug-ins (Twitter @jmeter_plugins).
Loadosophia.org (Twitter @loadosophia). displays results of JMeter runs uploaded to its site from Google accounts.
Ophir Prusak of BlazeMeter presents YOUTUBE: Learn JMeter in 60 minutes in the YOUTUBE: JMeter Tutorials channel and YOUTUBE: BlazeMeter Support channel from BlazeMeter provides higher scalability and other features than what JMeter provides on its own.
Blog at QGIS about Jmeter v2.4 by Tomáš Pospíšek in 4.1.2011. A part of a series of blogs about JMeter.
Enjoy the ads with easy navigation to tutorials at Tutorialspoint.com
Alexander Fuhr's German website on JMeter by has screen prints which shows off JMeter's localization.
JMeter is written in the Java language, with a generated Javadoc.
In early versions, Jmeter consisted of a Master system (the Jmeter GUI) which controls remote slave systems running jmeter-server instances which concurrently imposes load on a target server, network or object under test by emulating traffic to and from client software.
The JMeter GUI (ApacheJmeter.jar in the bin folder) is a multi-threaded Java class running Java Swing interfaces. It is invoked using jmeter.bat.
jmeter-server communicates with multiple remote injector Java RMIRegistry services.
Remote servers by default listens to port 1099.
A Test Plan is a container for elements which specifies the parameters for test runs.
Config. elements and Listeners can be on any level.
Samplers store monitor server metrics into .jtl (JMeter Test Log) files.
Unlike LoadRunner, JMeter doesn’t have built-in recording to generate code for playback. So Badboy is installed for that.
Each Thread Group simulates what
LoadRunner
calls an individual virtual user.
Each thread is a unit of work that can be executed simultaneously or sequentially.
To each thread group can be added Logic Controllers and
Elements.
JMeter has a multi-threaded architecture that enables Java developers to extend JMeter with custom plugins and functionality extensions, listed at code.google.com/p/jmeter-plugins/, described here.
JMeter presents graphs of run results (end-to-end performance under loads over time). Does LoadRunner provide wider flexiblity in formatting and more fine-grained analysis?
The jp@gc Graphs Generator from
DevX article by Javid Jamae and Kulvir Bhogal
Build Quality Apps with JMeter 5 page article (dated August 2002) by Peter Varhol
Use Homebrew to also add plugins JMeterPlugins Standard, Extras, ExtrasLibs, WebDriver and Hadoop:
Open jmeter.sh where it was installed:
To select Mac System Look and feel:
Menu > Options > Look and Feel > System
open /usr/local/bin/jmeter
Identify the folder path where you will be downloading JMeter.
Example: C:\projects\Perf\
If you use the Eclipse IDE:
Example: ...\eclipse\workspace\
Download from the middle of this page a JMeter Binary file such as apache-jmeter-2.11.zip for Windows machines. Download .tgz for use on Linux or Apple Macs.
Installer files have grown over the years
If there is a difficulty, change the mirror listed.
Verify that the downloaded file contains all the bytes.
Since Microsoft does not provide an MD5 verification program with its operating system,
you need to download one from
fourmilab or
pc-tools.net or
slavasoft.
Click on the [md5] link associated with the JMeter file you downloaded. Highlight and copy what looks like this:
314099349e1b7edc5de7005d9311c5ad *jmeter-2.11.zipThere is no need to also download the JMeter Source files if you are not intending to add to it.
For reference later, after unzipping, we copy the zip file inside the expanded folder.
JMeter is a Java application. But JMeter ignores the environment variables CLASSPATH referenced by other Java programs.
Files from JMeter are organized into folders common to most Unix distributions:
The JMeter GUI is invoked by specifying the jar file which java.exe JRE invokes from within the JMETER_BIN folder:
This statement is within bin file jmeter.bat, which creates environment variable ARGS containing all parameters jmeter uses, which includes the PERM variable to specify JVM permanent space allocation.
If needed, system environment variable JVM_ARGS can be defined to specify additional java options needed by custom Java extensions, e.g. -Dprop=val
Additionally, run parameters read by the JMeter java program can be specified:
-n specifies JMeter to run in non-gui (command line) mode.
-t precedes the name of the .jmx file containing the Test Plan.
-l precedes the name of the .jtl JMeter Test Log file containing sample results.
-r or --runremote runs all remote servers specified in jmeter.properties The default is the localhost:
If the site to be tested is behind a corporate proxy, add:
In the bin folder .cmd files jmeter-n.cmd and jmeter-n-r.com have these parameters pre-specified. The "-n" and "-r" in the name reflect the JMeter run parameters within each cmd file.
A jmx test file can be executed by dragging it from one Windows Explorer and dropping it onto the cmd file shown on another Windows Explorer window.
If you see a black screen flash and disappear, a pause command is needed.
Alternately, for the convenience of one-click invocation, we create a custom cmd file containing the jmx file to be executed. For example, custom invocation file SimpleTestPlan.cmd would contain:
jmeter.bat -t%JMETER_HOME%\printable_docs\demos\SimpleTestPlan.jmx
-Ljmeter.engine=DEBUG -X
pause
-LDEBUG is equivalent to -Ljmeter.engine=DEBUG
-G defines a JMeter property sent to all remote servers.
-Jx=2 defines a local JMeter property named "x" with value "2"
referenced within test plans as variable ${__property(x)}. This is used to define
the threads, rampup, and loops for each group.
-D defines a Java system property. This is needed to get around
connection exceptions
-Djava.rmi.server.hostname=192.168.5.6
-X exits the server after running a single test. This overrides the properties value to exit after running a single test:
jmeter -?
See usermanual jmeter_proxy_step_by_step.pdf on setting up the proxy to record a HTTP session.
There are several reasons to edit the jmeter.properties file.
To exit after running a single test:
The jmeter.properties file contains references to other properties files:
Sample test plans from the installer in folder \printable_docs\demos are:
Within a .jmx file, the first line identifies it as being encoded in UTF-8. So it's better to open .jmx files using a text editor such as WordPad, which knows to save in that format. (rather than Notepad).
<jmeterTestPlan version="1.2" properties="2.1">
This second line specifies which version of the
JMeter API to which the file was defined.
All content sections are nested within hashTree tags. I don't know why.
Values in the TestPlan section are pulled from properties files.
The number within ThreadGroup.start_time and end_time (1211836583000 in v3.2) is (when the trailing "000" is removed), the Unix Epoch time for "Mon, 26 May 2008 21:16:23 UTC".
YouTube Video:
jmeter getting started uses a Mac to create a HTTP Proxy.
Jörg Erdmenger's
vimeo:
Apache JMeter - The basics tutorial on contextual settings.
Apache JMeter Getting Started Tutorial
Apache Jmeter with a simulated login
Download and open this template file I start with when creating a JMeter Test Case (based on this wiki page).
From: An Amazing Open-Source Performance Testing Tool – Jmeter written by Gallop, an Indian outsourcer. |
HTML Link Parser, HTTP URL Re-writing Modifier, HTML Parameter Mask, HTTP User Parameter Modifier, User Parameters, Counter, BeanShell PreProcessor
The JUnit Sampler includes methods for "oneTimeSetUp" and "oneTimeTearDown". These should be thread-safe (not static methods).
Regular Expression Extractor, XPath Extractor, Result Status Action Handler, Save Responses to a file, Generate Summary Results, BeanShell PostProcessor
Sample Result Save Configuration, Graph Full Results, Graph Results, Spline Visualizer, Assertion Results, Aggregate Report, View Results in Table, Simple Data Writer, Monitor Results, Distribution Graph (alpha), Aggregate Graph, Mailer Visualizer, BeanShell Listener, Summary Report
View Results Tree requires a large amount of memory and processing resources.
"Parsing XML is CPU intensive. On a Pentium 4 2.4ghz cpu, 50 threads is the upper limit."
JMeter Wiki page How do I parameterize my JMeter test cases? outlines Regular Expressions to define user id's and other variables.
JMeter scans jar files in jmeter/lib/junit (instead of /lib directory) for classes extending junit's TestCase class.
TestNG ???
JMeter's 9.8MB Java 1.4/AWT-based source can be altered to add plug-ins that reference custom objects such as those in custom JDBC apps.
Download the source.
The JMeter GUI recognizes key combinations, which are faster than menu:
http://code.google.com/p/jmeter-reports aims to improve JMeter's reports presentation of a performance tests execution for a better and easier analysis of the results.
JMeter collects its own metrics from servers under test (such as CPU utilization), so if servers already have monitors in place, it's better to run JMeter without its normal monitors, and have the monitoring software monitor how many thread groups (vusers) is running.
Here's how to instrument JMeter for the Intersperse console.
remote.1.server.url=service\:jmx\:rmi\:///jndi/rmi\://host\:8004/jmxrmi
remote.1.server.name=JMeter
Note: The "\:" escape characters are automatically converted.
JMeter Java code is not "object oriented" in that it has a flat name and value pairs.
FunkLoad test is Python based. webunit.