2. What is Load Testing?
• Load testing is the process of putting demand
on a system or device and measuring its
response
• Load testing is performed to determine a
system’s behavior under both normal and
anticipated peak load conditions
• Not to find functional bugs
4. User User User User User User User User User User User User User User User
User User
App
4
Spike Use - Many Concurrent
5. User User User User User User User User User User User User User User User
User User
App
5
Spike Use - Many Concurrent
6. Load Testing
Key goals:
Can app support expected concurrent users?
How the key functionalities are performing?
Speed - does the system respond quickly enough
Capacity - is the infrastructure sized adequately
Stability - does the system behave correctly under load
At what load does the app break?
Steps:
Identify primary user paths
Identify expected concurrent users
Both now and down the road
Set up virtual users to hit the app
Run the test
Analyze the results
7. Why do load tests fail?
Ignoring the client processing time
Scripts not checking for valid responses
Poor workload modeling
Poor test data
Bad Load Test Environments
Assuming perfect users
Issues with Load generation box
Internet Bandwidth
9. Advantages with JMeter
Easy to install and use:
Free!
Java — most platforms
GUI vs. command line
Just download and run!
Feature Rich:
Record from browser
Read test data from files
Add logic, variables & functions
Run a test from multiple machines
Test many protocols, not just HTTP
10. Installing & Running JMeter
1. Download from http://jakarta.apache.org/jmeter
2. Unzip (path with no spaces preferred)
3. Go to "bin" directory
4. Run appropriate file
a. Windows: Double-click jmeter.bat
b. Unix/Mac: Run ./jmeter from command line
11. Your Tests vs Jmeter Features
1. Send/Receive
Request/response
2. Check if you are in correct
page.
3. Parse the response and get
required value.
4. Simulate user Think Time.
5. Conditional statements
6. I want to configure my server
url, data etc
7. View & Analyze the results
1. Sampler
2. Assertion
3. Pre/Post Processors
4. Timers
5. Logic Controllers
6. Config Elements
7. Listeners
12. Let’s build a small JMeter script
No parameterization:
Go to Login page
Enter user details
Go to Home page.
Parameterize the test:
Use Http Request Defaults feature
Read data from variables and CSV file.
13. Recording scripts in Jmeter
Try Http Proxy Server in JMeter:
Change browser proxy settings to Jmeter ( localhost,
8080)
Start Jmeter with Proxy:
Jmeter.bat -H ProxyServerName -P PortNumber
Work Bench -> Add ->Non Test Elements-> Http Proxy
Server
Navigate to the website
Everything gets recorded.
Delete unnecessary entries.
14. Limitations of JMeter
Can't run embedded Javascript, Flash, etc.
But ... use recording to capture those requests
Limited by your computer's network connection
You may have to work with IT to optimize
1 computer limited to about ~300 concurrent users
But... use multiple slave computers to handle more
Reports are a bit lacking
But... save results and import into Excel, etc.
15. What else need to be picked up?
For Advanced Jmeter Scripting:
Regular Expressions
Java ( to use in Bean Shell scripting)