jmeter/docs/usermanual/boss.html

213 lines
16 KiB
HTML

<!DOCTYPE html SYSTEM "about:legacy-compat">
<html lang="en"><head><META http-equiv="Content-Type" content="text/html; charset=iso-8859-15"><title>Apache JMeter
-
User's Manual: My boss wants me to...</title><meta name="author" value="Martin Ramshaw"><meta name="email" value="mramshaw at alumni.concordia.ca"><meta name="author" value="Philippe Mouawad"><meta name="email" value="p.mouawad at ubik-ingenierie.com"><meta name="viewport" content="width=device-width, initial-scale=1"><link href="http://fonts.googleapis.com/css?family=Merriweather:400normal" rel="stylesheet" type="text/css"><link rel="stylesheet" type="text/css" href="../css/new-style.css"></head><body role="document"><a href="#content" class="hidden">Main content</a><div class="header"><!--
APACHE LOGO
--><div><a href="http://www.apache.org"><img title="Apache Software Foundation" width="290" height="75" src="../images/asf-logo.png" alt="Logo ASF"></a></div><!--
PROJECT LOGO
--><div><a href="http://jmeter.apache.org/"><img src="../images/logo.jpg" alt="Apache JMeter"></a></div><div class="twitter"><div><a href="https://twitter.com/share" class="twitter-share-button" data-text="Powerful Load Testing with Apache #JMeter" data-via="ApacheJMeter" data-lang="en-gb" data-size="large">Tweet</a><script>
(function(d,s,id){
var js,
fjs=d.getElementsByTagName(s)[0],
p=/^http:/.test(d.location)?'http':'https';
if (!d.getElementById(id)) {
js=d.createElement(s);
js.id=id;
js.src=p+'://platform.twitter.com/widgets.js';
fjs.parentNode.insertBefore(js,fjs);
}
})(document, 'script', 'twitter-wjs');
</script></div><div><a href="https://twitter.com/ApacheJMeter" class="twitter-follow-button" data-show-count="false" data-lang="en-gb" data-size="large">Follow</a><script>(function(d,s,id){
var js,
fjs=d.getElementsByTagName(s)[0],
p=/^http:/.test(d.location)?'http':'https';
if (!d.getElementById(id)) {
js=d.createElement(s);
js.id=id;
js.src=p+'://platform.twitter.com/widgets.js';
fjs.parentNode.insertBefore(js,fjs);
}
})(document, 'script', 'twitter-wjs');
</script></div></div><div class="banner"><iframe src="http://www.apache.org/ads/bannerbar.html" style="border-width:0;" frameborder="0" scrolling="no"></iframe><div class="clear"></div></div></div><div class="nav"><ul class="menu"><li><div class="menu-title">About</div><ul><li><a href="../index.html">Overview</a></li><li><a href="http://twitter.com/ApacheJMeter">JMeter on Twitter<img src="../images/twitter.png" alt="Icon for JMeter on Twitter"></a></li><li><a href="../issues.html">Issue Tracking</a></li><li><a href="http://projects.apache.org/feeds/rss/jmeter.xml">Subscribe to What's New</a></li><li><a href="http://www.apache.org/licenses/">License</a></li></ul></li></ul><ul class="menu"><li><div class="menu-title">Download</div><ul><li><a href="../download_jmeter.cgi">Download Releases</a></li><li><a href="../nightly.html">Developer (Nightly) Builds</a></li></ul></li></ul><ul class="menu"><li><div class="menu-title">Documentation</div><ul><li><a href="../changes.html">Changes per version</a></li><li><a href="../usermanual/get-started.html">Get Started</a></li><li><a href="../usermanual/index.html">User Manual</a></li><li><a href="../usermanual/best-practices.html">Best Practices</a></li><li><a href="../usermanual/component_reference.html">Component Reference</a></li><li><a href="../usermanual/functions.html">Functions Reference</a></li><li><a href="../api/index.html">Javadocs</a></li><li><a href="../building.html">Building JMeter and Add-Ons</a></li><li><a href="http://wiki.apache.org/jmeter">JMeter Wiki</a></li><li><a href="http://wiki.apache.org/jmeter/JMeterFAQ">FAQ (Wiki)</a></li></ul></li></ul><ul class="menu"><li><div class="menu-title">Tutorials (PDF format)</div><ul><li><a href="../usermanual/jmeter_distributed_testing_step_by_step.pdf">Distributed Testing</a></li><li><a href="../usermanual/jmeter_proxy_step_by_step.pdf">Recording Tests</a></li><li><a href="../usermanual/junitsampler_tutorial.pdf">JUnit Sampler</a></li><li><a href="../usermanual/jmeter_accesslog_sampler_step_by_step.pdf">Access Log Sampler</a></li><li><a href="../extending/jmeter_tutorial.pdf">Extending JMeter</a></li></ul></li></ul><ul class="menu"><li><div class="menu-title">Community</div><ul><li><a href="http://wiki.apache.org/jmeter/JMeterCommitters">Contributors</a></li><li><a href="../mail.html">Mailing Lists</a></li><li><a href="../svnindex.html">SVN Repositories</a></li></ul></li></ul><ul class="menu"><li><div class="menu-title">Foundation</div><ul><li><a href="http://www.apache.org/">ASF</a></li><li><a href="http://www.apache.org/foundation/getinvolved.html">Get Involved in the ASF</a></li><li><a href="http://www.apache.org/foundation/sponsorship.html">Sponsorship</a></li><li><a href="http://www.apache.org/foundation/thanks.html">Thanks</a></li></ul></li></ul></div><div class="main" id="content"><ul class="pagelinks"><li><a href="best-practices.html">&lt; Prev</a></li><li><a href="../index.html">Index</a></li><li><a href="component_reference.html">Next &gt;</a></li></ul><div class="section"><h1 id="boss">17. Help! My boss wants me to load test our application!<a class="sectionlink" href="#boss" title="Link to here">&para;</a></h1>
<p>This is a fairly open-ended proposition. There are a number of questions to
be asked first, and additionally a number of resources that will be needed. You
will need some hardware to run the benchmarks/load-tests from. A number of
tools will prove useful. There are a number of products to consider. And finally,
why is Java a good choice to implement a load-testing/Benchmarking product.
</p>
<div class="subsection"><h2>17.1 Questions to ask<a class="sectionlink" href="#questions" title="Link to here">&para;</a></h2>
<p>What is our anticipated average number of users (normal load) ?
</p>
<p>What is our anticipated peak number of users ?
</p>
<p>When is a good time to load-test our application (i.e. off-hours or week-ends),
bearing in mind that this may very well crash one or more of our servers ?
</p>
<p>Does our application have state ? If so, how does our application manage it
(cookies, session-rewriting, or some other method) ?
</p>
<p>What is the testing intended to achieve?</p>
</div>
<div class="subsection"><h2>17.2 Resources<a class="sectionlink" href="#resources" title="Link to here">&para;</a></h2>
<p>The following resources will prove very helpful. Bear in mind that if you
cannot locate these resources, <b>you</b> will become these resources. As you
already have your work cut out for you, it is worth knowing who the following
people are, so that you can ask them for help if you need it.
</p>
<div class="subsection"><h2>17.2.1 Network<a class="sectionlink" href="#network" title="Link to here">&para;</a></h2>
<p>Who knows our network topology ? If you run into any firewall or
proxy issues, this will become very important. As well, a private
testing network (which will therefore have very low network latency)
would be a very nice thing. Knowing who can set one up for you
(if you feel that this is necessary) will be very useful. If the
application doesn't scale as expected, who can add additional
hardware ?
</p>
</div>
<div class="subsection"><h2>17.2.2 Application<a class="sectionlink" href="#application" title="Link to here">&para;</a></h2>
<p>Who knows how our application functions ? The normal sequence is
<ul>
<li>test (low-volume - can we benchmark our application?)</li>
<li>benchmark (the average number of users)</li>
<li>load-test (the maximum number of users)</li>
<li>test destructively (what is our hard limit?)</li>
</ul>
The <b>test</b> process may progress from black-box testing to
white-box testing (the difference is that the first requires
no knowledge of the application [it is treated as a "black box"]
while the second requires some knowledge of the application).
It is not uncommon to discover problems with the application
during this process, so be prepared to defend your work.</p>
</div>
</div>
<div class="subsection"><h2>17.3 What platform should I use to run the benchmarks/load-tests ?<a class="sectionlink" href="#platform" title="Link to here">&para;</a></h2>
<p>This should be a widely-used piece of hardware, with a standard
(i.e. vanilla) software installation. Remember, if you publish your results,
the first thing your clients will do is hire a graduate student to verify them.
You might as well make it as easy for this person as you possibly can.
</p>
<p>For Windows, Windows XP Professional should be a minimum (the others
do not multi-thread past 50-60 connections, and you probably anticipate
more users than that).
</p>
<p>Good free platforms include the linuxes, the BSDs, and Solaris Intel. If
you have a little more money, there are commercial linuxes.
This may be worth it if you need the support.
</p>
<p>
For non-Windows platforms, investigate "ulimit -n unlimited" with a view to
including it in your user account startup scripts (.bashrc or .cshrc scripts
for the testing account).
</p>
<p>As you progress to larger-scale benchmarks/load-tests, this platform
will become the limiting factor. So it's worth using the best hardware and
software that you have available. Remember to include the hardware/software
configuration in your published benchmarks.
</p>
<p><b>When you need a lot of machines or want to test the network latency, Cloud can help you.</b>
JMeter can easily be installed on Cloud instances as it runs on nearly any architecture available in the Cloud.
JMeter is also supported within Commercial Cloud PAAS if you don't want to manage it yourself.
</p>
<p>Don't forget JMeter batch (NON-GUI) mode. This mode should be used during load testing for many reasons:
<ul>
<li>If you have a powerful server that supports Java but perhaps does not have a fast graphics implementation, or where you need to login remotely.</li>
<li>Batch (non-GUI) mode can reduce the network traffic compared with using a remote display or client-server mode.</li>
<li>Java AWT Thread used for GUI mode can alter injection behaviour by blocking sometimes</li>
</ul>
The batch log file can then be loaded into JMeter on a workstation for analysis, or you can
use CSV output and import the data into a spreadsheet.</p>
<div class="clear"></div><div class="note">Remember GUI mode is for Script creation and debugging, not for load testing</div><div class="clear"></div>
</div>
<div class="subsection"><h2>17.4 Tools<a class="sectionlink" href="#tools" title="Link to here">&para;</a></h2>
<p>The following tools will all prove useful. It is definitely worthwhile to
become familiar with them. This should include trying them out, and reading the
appropriate documentation (man-pages, info-files, application --help messages,
and any supplied documentation).
</p>
<div class="subsection"><h2>17.4.1 ping<a class="sectionlink" href="#ping" title="Link to here">&para;</a></h2>
<p>
This can be used to establish whether or not you can reach your
target site. Options can be specified so that 'ping' provides the
same type of route reporting as 'traceroute'.
</p>
</div>
<div class="subsection"><h2>17.4.2 nslookup/dig<a class="sectionlink" href="#dig" title="Link to here">&para;</a></h2>
<p>
While the <u>user</u> will normally use a human-readable internet
address, <u>you</u> may wish to avoid the overhead of DNS lookups when
performing benchmarking/load-testing. These can be used to determine
the unique address (dotted quad) of your target site.
</p>
</div>
<div class="subsection"><h2>17.4.3 traceroute<a class="sectionlink" href="#traceroute" title="Link to here">&para;</a></h2>
<p>
If you cannot "ping" your target site, this may be used to determine
the problem (possibly a firewall or a proxy). It can also be used
to estimate the overall network latency (running locally should give
the lowest possible network latency - remember that your users will
be running over a possibly busy internet). Generally, the fewer hops
the better.
</p>
</div>
</div>
<div class="subsection"><h2>17.5 How can I enhance JMeter ?<a class="sectionlink" href="#plugins" title="Link to here">&para;</a></h2>
<p>There a lot of open-source and commercial plugins that can enhance JMeter, let's mention here the main open-source ones:
</p>
<div class="subsection"><h2>17.5.1 JMeter-Plugins<a class="sectionlink" href="#jmeter-plugins" title="Link to here">&para;</a></h2>
<p>This <a href="http://jmeter-plugins.org/" target="_blank">non official project</a> is THE companion to core JMeter.<br>
It provides many useful extensions, among which:
<ul>
<li>Active Threads Over Time Graph Listener</li>
<li>Response Times vs Threads Graph Listener</li>
<li>Transaction Throughput vs Threads Graph Listener</li>
<li>GraphGenerator listener to create graphs at end of a load test</li>
<li>Selenium WebDriver Sampler</li>
<li>....</li>
</ul>
</p>
</div>
<div class="subsection"><h2>17.5.2 JMeter Plugin for Maven<a class="sectionlink" href="#jmeter-maven-plugin" title="Link to here">&para;</a></h2>
<p>This <a href="http://jmeter.lazerycode.com/" target="_blank">non official plugin</a> allows you to run your automated JMeter tests through Maven.</p>
</div>
<div class="subsection"><h2>17.5.3 JMeter Performance Plugin<a class="sectionlink" href="#jmeter-performance-plugin" title="Link to here">&para;</a></h2>
<p>This <a href="https://wiki.jenkins-ci.org/display/JENKINS/Performance+Plugin" target="_blank">non official plugin</a> allows you to capture reports from JMeter and JUnit.<br>
Jenkins will generate graphic charts with the trend report of performance and robustness.
It includes the feature of setting the final build status as good, unstable or failed, based on the reported error percentage.
</p>
</div>
<div class="subsection"><h2>17.5.4 JMeter plugin for AWS<a class="sectionlink" href="#jmeter-ec2" title="Link to here">&para;</a></h2>
<p>This <a href="https://github.com/oliverlloyd/jmeter-ec2" target="_blank">non official plugin</a> automates running Apache JMeter on Amazon EC2</p>
</div>
</div>
<div class="subsection"><h2>17.6 Why Java ?<a class="sectionlink" href="#java" title="Link to here">&para;</a></h2>
<p>Why not Perl or C ?
</p>
<p>Well, Perl might be a very good choice except that the Benchmark package
seems to give fairly fuzzy results. Also, simulating multiple users with
Perl is a tricky proposition (multiple connections can be simulated by forking
many processes from a shell script, but these will not be threads, they will
be processes). However, the Perl community is very large. If you find that
someone has already written something that seems useful, this could be a very
good solution.
</p>
<p>C, of course, is a very good choice (check out the Apache <b>ab</b> tool).
But be prepared to write all of the custom networking, threading, and state
management code that you will need to benchmark your application.
</p>
<p>Java gives you (for free) the custom networking, threading, and state
management code that you will need to benchmark your application. Java is
aware of HTTP, FTP, and HTTPS - as well as RMI, IIOP, and JDBC (not to mention
cookies, URL-encoding, and URL-rewriting). In addition Java gives you automatic
garbage-collection, and byte-code level security.
</p>
</div>
</div><ul class="pagelinks"><li><a href="best-practices.html">&lt; Prev</a></li><li><a href="../index.html">Index</a></li><li><a href="component_reference.html">Next &gt;</a></li></ul></div><div class="footer"><div class="copyright">
Copyright &copy;
1999 &ndash;
2015
, Apache Software Foundation
</div><div class="trademarks">Apache, Apache JMeter, JMeter, the Apache
feather, and the Apache JMeter logo are
trademarks of the
Apache Software Foundation.
</div></div></body></html>