20
A Really Really Really Basic Introduction into Load & Stress Testing with Apache JMeter (c) 2010 agilitator.com

Apache JMeter - A Brief Introduction

Embed Size (px)

DESCRIPTION

A very brief introduction to web application load/stress testing with Apache JMeter

Citation preview

Page 1: Apache JMeter - A Brief Introduction

A Really

ReallyReally

Basic Introduction into

Load & Stress Testingwith Apache JMeter

(c) 2010 agilitator.com

Page 2: Apache JMeter - A Brief Introduction

Performance, Load and Stress Testing Objectives

PerformanceFind bottlenecks, and establish a baseline

for the system operational loadLoad

Profile the system's behavior under the top load it was designed to work under

StressAttempt to break the system by

overwhelming its resources

(c) 2010 agilitator.com

Page 3: Apache JMeter - A Brief Introduction

All of the above (and more)“Apache JMeter is an open source 100% pure Java desktop application designed to load test functional behavior and measure performance. It was originally designed for testing Web Applications but has since expanded to other test functions.”

Source: http://jakarta.apache.org/jmeter/

(c) 2010 agilitator.com

Page 4: Apache JMeter - A Brief Introduction

Let’s get startedDownload JMeter from Apache Websitehttp://jakarta.apache.org/site/

downloads/downloads_jmeter.cgiFor *nix systems: .tgz archiveFor Windows: .zip archive

Extract archive into a local directoryNavigate to jakarta-jmeter-2.*.*\bin directoryLaunch JMeter GUI (make sure that Java is installed on your computer..)

jmeter.bat (Windows)jmeter.sh (*nix)

(c) 2010 agilitator.com

Page 5: Apache JMeter - A Brief Introduction

JMeter on Windows(c) 2010 agilitator.com

Page 6: Apache JMeter - A Brief Introduction

Apache JMeter GUI(c) 2010 agilitator.com

Page 7: Apache JMeter - A Brief Introduction

Add a Thread Group(c) 2010 agilitator.com

Page 8: Apache JMeter - A Brief Introduction

Meet your testers

• 100 simultaneous users• activated at the rate 10 per second• runs only once

(c) 2010 agilitator.com

Page 9: Apache JMeter - A Brief Introduction

Sampling – what?

Samplers describe your test target – what, where and how.HTTP Request access web site over – what else – HTTP !

(c) 2010 agilitator.com

Page 10: Apache JMeter - A Brief Introduction

An HTTP Request

There are quite a few options to be configured… For this basic introduction let’s keep things simple

(c) 2010 agilitator.com

Page 11: Apache JMeter - A Brief Introduction

Filling in the blanks

At the very least, you need to supply the following:

• URL for the website you are going to test• Port # - default is 80 (and you may leave it blank)• the page/directory to send request to (“/” stands for root)

(c) 2010 agilitator.com

Page 12: Apache JMeter - A Brief Introduction

Can I run my tests now?

As a matter of fact – you can!

The catch? You would not get any results back.

You need to add a

LISTENER

to display the information you'll be getting back

(c) 2010 agilitator.com

Page 13: Apache JMeter - A Brief Introduction

Adding a Listener

Summary Report is one of the most basic ones; it displays data in a table format

(c) 2010 agilitator.com

Page 14: Apache JMeter - A Brief Introduction

A Summary Report: what you see is what you get

Nothing to configure here, though you might want to supply a file name to where the results of the test might be saved.By default, the file will be written to \jakarta-jmeter-2.*.*\bin directory; use the browse button to specify different location

NB: if file does not exist already, JMeter will pop up an error message: “Could not open the file”. Ignore it, the file will be created in the specified directory after first run

(c) 2010 agilitator.com

Page 15: Apache JMeter - A Brief Introduction

Save your test plan

Before you run your test you have to save the configuration; it is saved into a file with JMX extension

(c) 2010 agilitator.com

Page 16: Apache JMeter - A Brief Introduction

Run the test, sit backand observe results!

After running your test several times, you’ll notice that historic results begin to accumulate in the table. To clear the slate use Run > Clear menu option (or press Ctrl-Shift-E)

(c) 2010 agilitator.com

Page 17: Apache JMeter - A Brief Introduction

Making (some) sense out of the results

• you’ve run total of 100 samples – HTTP requests to amazon.com• average response time – 920 milliseconds• min, max and standard deviation values are also provided• on average you’ve received 89698.6 bytes per page• no errors – page faults

amazon.com

google.com

testing google.com with same parameters yield 23 milliseconds average response time, with 10 times less data transfer

(c) 2010 agilitator.com

Page 18: Apache JMeter - A Brief Introduction

Just Scratching the Surface!

What this really, really, really basic introduction did not cover?Why, everything else!

(c) 2010 agilitator.com

Page 19: Apache JMeter - A Brief Introduction

Next steps

There are 20+ samplers, 15+ listeners, pre- and post-processors, assertions, timers, schedulers

as well as several configuration options for each.(And we haven’t even touched

the Workbench!... )Get more of JMeter on:

http://jakarta.apache.org/jmeter/

all rights reserved (c) 2010 agilitator.com

Page 20: Apache JMeter - A Brief Introduction

all rights reserved (c) 2010 agilitator.com

Your feedback is always welcome at:

[email protected]