34
Load Testing Why we need it? What tools to use?

QA. Load Testing

Embed Size (px)

Citation preview

Page 1: QA. Load Testing

Load Testing

Why we need it?What tools to use?

Page 2: QA. Load Testing

Load Testing Goals- Checking maximum simultaneous requests (Determining infrastructure limits)

- Verifying acceptance of response time during high load

- Verifying system stability under load - look for memory leaks in long tests

- Predict future resource needs and architectural improvements

- Verifying system behaviour after high load

- Evaluating current capacity against defined requirements

More reasons are listed at http://performance-testing.org/performance-testing-reasons

Page 3: QA. Load Testing

Open Source Tools

- JMeter

- Yandex Tank

- Taurus

Page 4: QA. Load Testing

JMeterThe Apache JMeter™ application is open source software,

a 100% pure Java application

Page 5: QA. Load Testing

Steps to start load testing1)Launch application (jmeter.sh for Unix-based systems and

jmeter.bat for Windows)

2)Right-button click on Test Plan and select Add > Threads (Users) > Thread group (preferably jp@gc - Ultimate Thread Group)

3)Configure Start Thread Count (amount of virtual users which will load your website), Startup Time (time for reaching amount of VU defined), Hold Load For (time for holding peak amount of VU defined), Shutdown Time (time for decreasing VUs by stopping requests)

Page 6: QA. Load Testing

JMeter - Step 2 - Select Ultimate Thread Group

Page 7: QA. Load Testing

JMeter - Step 3 - Thread’s configuration

Page 8: QA. Load Testing

Steps to start load testing (part 2)4) Right-button click on Thread and select Add > Config Element > HTTP Request Default

5) Configure Server Name or IP (e.g. youwebsite.com or 123.231.321.123), Port Number (e.g. 80) and Protocol (http or https)

Page 9: QA. Load Testing

JMeter - Step 4 - select HTTP Request Defaults

Page 10: QA. Load Testing

JMeter - Step 5 - Configure HTTP Request Defaults

Page 11: QA. Load Testing

Steps to start load testing (part 3)6) Right-button click on Thread and select Add > Sampler > HTTP Request

7) Configure Path (link to page you would like to test; e.g. /login.php or /blog/about) and specify Method GET

Page 12: QA. Load Testing

JMeter - Step 6 - Select Sampler HTTP Request

Page 13: QA. Load Testing

JMeter - Step 7 - Configure Sampler HTTP Request

Page 14: QA. Load Testing

Steps to start load testing (part 4)8) Right-button click on Thread and select

Add > Listener > jp@gc - Hits per Second

Add > Listener > jp@gc - Response Times vs Threads

Add > Listener > jp@gc - Response Latencies Over Time

Add > Listener > jp@gc - Response Codes per Second

9) Finally… Run test plan by clicking on Start

Page 15: QA. Load Testing

JMeter - Step 8 - Configure Sampler HTTP Request

Page 16: QA. Load Testing

JMeter - 30 VUs - Hits per second

Page 17: QA. Load Testing

JMeter - 30 VUs - Response Time Over Time

Page 18: QA. Load Testing

JMeter - 30 VUs - Latencies Over Time

Page 19: QA. Load Testing

JMeter - 30 VUs - Response Codes per Second

Page 20: QA. Load Testing

NotesUser “Run” > “Clear All” before starting new test

Once you identified the issue with server responses try to decrease Start Threads Count and increase Startup Time to get to accurate value of allowed concurrent connections

Page 21: QA. Load Testing

IssuesHow to identify issues with JMeter

Page 22: QA. Load Testing

JMeter - 50 VUs - 500 Response codes

Page 23: QA. Load Testing

Server is down...

Page 24: QA. Load Testing

Really down...

Page 25: QA. Load Testing

Short term solutionsRestart Servers

Tune configuration of web servers

Add more servers

Page 26: QA. Load Testing

Long term solutionsConsider moving infrastructure to the Cloud

Use CDN

Use different domains for static resources (and fast web servers for them; e.g. Ngnix or lighttpd)

Use memcached for storing mostly used DB queries

Use downstream cacheability headers

Consider moving part of the application logic to microservices

Setup auto-scale at your Cloud provider

Page 27: QA. Load Testing

Cloud Solutions

Page 28: QA. Load Testing

Only JMeter?What other tools can be used for load testing?

Page 29: QA. Load Testing

Load Testing Tools

- JMeter

- Yandex.Tank

- Gatling

- Locust

- Taurus

- The Grinder

Find more at http://alternativeto.net/

Page 30: QA. Load Testing

Commercial Solutions

Page 31: QA. Load Testing

Popular Commercial SolutionsSOASTA

https://www.soasta.com/

BlazeMeter

https://www.blazemeter.com/

Page 32: QA. Load Testing

What Else? (topics for future slides)

Page 33: QA. Load Testing

Topics related to Load Testing- Functional Tests in JMeter (using runnable JAR files to automate

functional and load testing)

- PDF Reporting. BlazeMeter Sense (former Loadosophia)

- Response Data validation

- Continuous Load Testing. Configuring CI with headless JMeter

- Configuration of Master / Slave nodes to perform load testing using multiple workstations

Page 34: QA. Load Testing

Thank youQuestions?