load testing jmeter
TRANSCRIPT
![Page 1: Load testing jmeter](https://reader036.vdocuments.site/reader036/viewer/2022062412/58f05f831a28abe25a8b4643/html5/thumbnails/1.jpg)
Load Testing & JMeter
![Page 2: Load testing jmeter](https://reader036.vdocuments.site/reader036/viewer/2022062412/58f05f831a28abe25a8b4643/html5/thumbnails/2.jpg)
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
![Page 3: Load testing jmeter](https://reader036.vdocuments.site/reader036/viewer/2022062412/58f05f831a28abe25a8b4643/html5/thumbnails/3.jpg)
User User User
App
3
Normal Use - Few Concurrent
User User
![Page 4: Load testing jmeter](https://reader036.vdocuments.site/reader036/viewer/2022062412/58f05f831a28abe25a8b4643/html5/thumbnails/4.jpg)
User User User User User User User User User User User User User User User User User
App
4
Spike Use - Many Concurrent
![Page 5: Load testing jmeter](https://reader036.vdocuments.site/reader036/viewer/2022062412/58f05f831a28abe25a8b4643/html5/thumbnails/5.jpg)
User User User User User User User User User User User User User User User User User
App
5
Spike Use - Many Concurrent
![Page 6: Load testing jmeter](https://reader036.vdocuments.site/reader036/viewer/2022062412/58f05f831a28abe25a8b4643/html5/thumbnails/6.jpg)
Load TestingKey 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
![Page 7: Load testing jmeter](https://reader036.vdocuments.site/reader036/viewer/2022062412/58f05f831a28abe25a8b4643/html5/thumbnails/7.jpg)
Why do load tests fail?
Ignoring the client processing timeScripts not checking for valid responsesPoor workload modelingPoor test dataBad Load Test EnvironmentsAssuming perfect users Issues with Load generation box Internet Bandwidth
![Page 8: Load testing jmeter](https://reader036.vdocuments.site/reader036/viewer/2022062412/58f05f831a28abe25a8b4643/html5/thumbnails/8.jpg)
Load Testing Approaches
Open Source Tools:JmeterAB ( Apache Bench)Http_LoadThe GrinderSeige
Commercial Tools:LoadRunner WebLoadSilk Performer
![Page 9: Load testing jmeter](https://reader036.vdocuments.site/reader036/viewer/2022062412/58f05f831a28abe25a8b4643/html5/thumbnails/9.jpg)
Advantages with JMeter
Easy to install and use:Free!Java — most platformsGUI vs. command lineJust download and run!
Feature Rich:Record from browserRead test data from filesAdd logic, variables & functionsRun a test from multiple machinesTest many protocols, not just HTTP
![Page 10: Load testing jmeter](https://reader036.vdocuments.site/reader036/viewer/2022062412/58f05f831a28abe25a8b4643/html5/thumbnails/10.jpg)
Installing & Running JMeter
1. Download from http://jakarta.apache.org/jmeter2. Unzip (path with no spaces preferred)3. Go to "bin" directory4. Run appropriate file
a. Windows: Double-click jmeter.batb. Unix/Mac: Run ./jmeter from command line
![Page 11: Load testing jmeter](https://reader036.vdocuments.site/reader036/viewer/2022062412/58f05f831a28abe25a8b4643/html5/thumbnails/11.jpg)
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 statements6. I want to configure my server
url, data etc7. View & Analyze the results
1. Sampler
2. Assertion
3. Pre/Post Processors4. Timers5. Logic Controllers6. Config Elements7. Listeners
![Page 12: Load testing jmeter](https://reader036.vdocuments.site/reader036/viewer/2022062412/58f05f831a28abe25a8b4643/html5/thumbnails/12.jpg)
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.
![Page 13: Load testing jmeter](https://reader036.vdocuments.site/reader036/viewer/2022062412/58f05f831a28abe25a8b4643/html5/thumbnails/13.jpg)
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.
![Page 14: Load testing jmeter](https://reader036.vdocuments.site/reader036/viewer/2022062412/58f05f831a28abe25a8b4643/html5/thumbnails/14.jpg)
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.
![Page 15: Load testing jmeter](https://reader036.vdocuments.site/reader036/viewer/2022062412/58f05f831a28abe25a8b4643/html5/thumbnails/15.jpg)
What else need to be picked up?For Advanced Jmeter Scripting:
Regular Expressions Java ( to use in Bean Shell scripting)
![Page 16: Load testing jmeter](https://reader036.vdocuments.site/reader036/viewer/2022062412/58f05f831a28abe25a8b4643/html5/thumbnails/16.jpg)
Reference
http://jakarta.apache.org/jmeter38
![Page 17: Load testing jmeter](https://reader036.vdocuments.site/reader036/viewer/2022062412/58f05f831a28abe25a8b4643/html5/thumbnails/17.jpg)
Questions?