+ All Categories
Home > Technology > Load testing jmeter

Load testing jmeter

Date post: 14-Apr-2017
Category:
Upload: billa-kota-sriram
View: 239 times
Download: 1 times
Share this document with a friend
17
Load Testing & JMeter
Transcript
Page 1: Load testing jmeter

Load Testing & JMeter

Page 2: Load testing jmeter

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

User User User

App

3

Normal Use - Few Concurrent

User User

Page 4: Load testing jmeter

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

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

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

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

Load Testing Approaches

Open Source Tools:JmeterAB ( Apache Bench)Http_LoadThe GrinderSeige

Commercial Tools:LoadRunner WebLoadSilk Performer

Page 9: Load testing jmeter

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

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

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

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

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

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

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

Reference

http://jakarta.apache.org/jmeter38

Page 17: Load testing jmeter

Questions?


Recommended