Load Testing With JMeter
Load Testing With JMeter
Larry Davidson
October 21, 2008
What is Load Testing?
2
User User User User
App
App
App
Request Sampler
Report Listener
13
Let's run a Load Test already!
14
Setting Up Your First Load Test
Simulate users
Add > Thread Groups
Number of Threads (concurrent users) = 10
Rampup Time (seconds until users active) = 1
Loop Count (how many repetitions) = 1
Analyze reports
Add > Listener > Aggregate Graph
Add > Listener > View Results Tree
Running Your First Load Test
Choose "Run > Start" (ctrl-R)
Click on the "Aggregate Graph"
Data fills in as test runs
Click "Display Graph" for chart 47 threads (“users”) Running!
Response Data
Server response body (HTML, etc.)
View as text or rendered HTML, etc.
Let's get more advanced!
18
A Test with Three User Types
Users can do various things on a site
Good to simulate several common tasks at same time
For this demo, we’ll test 3 users
1. Yahoo Viewer
2. Google Viewer
3. CNN Viewer
To start, add 3 thread groups under Test Plan 19
${__javaScript(expression to evaluate)}
${__threadNum()}
${__Random(min, max, varname)}
${__regexFunction(regEx, template, match, ...)}
So what about reports?
32
Reading Reports
Most times are reported in milliseconds
Throughput
Requests per second
90% Line
Value below which 90% of request times fall
Standard Deviation
33
A measure of certainty / uncertainty
Measures variation from average
Latency
Delay between request and response
Response Time Goals to Aim For
0.1 second — perceived instant
1.0 second — uninterrupted flow
10 seconds — user loses interest
Going further...
35
Higher loads with multiple "slave" computers
http://jakarta.apache.org/jmeter
38