Top Banner
How to Start Performance Testing? Nebojsa Videnov 15 December 2015, Belgrade, Serbia PHP Meetup http://nos.twnsnd.co/
51

How to Start Performance Testing?

Jan 22, 2017

Download

Engineering

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: How to Start Performance Testing?

How to Start Performance Testing?

Nebojsa Videnov15 December 2015, Belgrade, SerbiaPHP Meetup

http://nos.twnsnd.co/

Page 2: How to Start Performance Testing?

I wish, I wish,..

https://stocksnap.io/author/622

Page 3: How to Start Performance Testing?

Agenda

Requirements

Vocabulary

Test Planning

JMeter

Takeaways

https://stocksnap.io/author/403 Jeffrey Betts

Page 4: How to Start Performance Testing?

Requirements

https://stocksnap.io/author/652 Daria Nepriakhina

Page 5: How to Start Performance Testing?

Badly formulated

“We expect 20 million users per year.”

“We anticipate 50,000 users a day.”

https://stocksnap.io/author/5574 Avel Chuklanov

Page 6: How to Start Performance Testing?

How to format Requirements?

● What does web site needs to do well?● What is usage pattern of the proposed system?● What is daily peak demand? ● How much testing environment is similar to production environment?● Can you provide a breakdown of the frequency of certain activities?

(for example, 75% browse, 2% check their order status, and so on)● Where is the project in terms of the overall project performance goals?● ...

Questions.

Page 7: How to Start Performance Testing?

Vocabulary

Page 8: How to Start Performance Testing?

What is a hit?

- HTTP request- Whole page- Entire visit by a given user

https://stocksnap.io/author/402 Skitter Photo

Page 9: How to Start Performance Testing?

What is a day?

Determining the period of time when most users arrive on the system becomes

critical for estimating peak load.

https://stocksnap.io/author/56 Sonja Langford

Page 10: How to Start Performance Testing?

Throughput

- Transaction per unit of time (Transaction pair - HTTP request and response)

- Page rate- User rate

https://stocksnap.io/author/3350 Will Langenberg

Page 11: How to Start Performance Testing?

Throughput plateau

Requests per second

Load

Throughput plateauSaturation point

10 30 8020 5040 7060

25

50

100

125Buckle point

Heavy load zone

Light load zone

THROUGHPUT

Page 12: How to Start Performance Testing?

Response Time

https://stocksnap.io/author/4440 Luis Llerena

Page 13: How to Start Performance Testing?

Standard Deviation

Standard Deviation is

measure of variability of data set.

https://stocksnap.io/author/3350 Will Langenberg

Page 14: How to Start Performance Testing?

90% Line90% Line is the value below which 90% of the samples fail.

https://stocksnap.io/author/9429 Raymond Sam

Page 15: How to Start Performance Testing?

Median

Number which divides the samples into two equal halves.

Half of the samples are smaller than the median and

half are larger.

https://stocksnap.io/author/4440 Luis Llerena

Page 16: How to Start Performance Testing?

Latency

Time between first request is sent until first byte of response reaches the client.

https://stocksnap.io/author/2784 Wil Stewart

Page 17: How to Start Performance Testing?

Concurrent Load

https://stocksnap.io/author/16087 Marcin Czaja

Page 18: How to Start Performance Testing?

Active Load

https://stocksnap.io/author/403 Jeffrey Betts

Page 19: How to Start Performance Testing?

Pick Load

Peak Load refers to the maximum concurrent users within some

time period.

https://stocksnap.io/author/408 Fré Sonneveld

Page 20: How to Start Performance Testing?

What is a user?

User is:1. User is a hit.2. User is all day visitor.

Once logged in for the whole day.user = whole set of activities by the user for the whole day.May or may not be very active.

3. User visit.visit = the most common usage of user

https://stocksnap.io/author/15749 Stephen Radford

Page 21: How to Start Performance Testing?

Thinking Time

Interval between user requests

https://stocksnap.io/author/17101 Greg Rakozy

Page 22: How to Start Performance Testing?

Steady stateThroughput

10 30 1020 5040 3040

25

50

100

125

Steady state

Ramp-downRamp-up

Load

Page 23: How to Start Performance Testing?

Ramp-up periodThroughput

10 30 1020 5040 3040

25

50

100

125

Steady state

Ramp-downRamp-up

Load

Page 24: How to Start Performance Testing?

Ramp-down periodThroughput

10 30 1020 5040 3040

25

50

100

125

Steady state

Ramp-downRamp-up

Load

Page 25: How to Start Performance Testing?

Operation ceiling

Number of concurrent users that the application can withstand before becoming totally unresponsive

https://stocksnap.io/author/5300 Joseph Barrientos

Page 26: How to Start Performance Testing?

Starting Performance Testing

http://nos.twnsnd.co/

Page 27: How to Start Performance Testing?

Team for Performance Testing

Page 28: How to Start Performance Testing?

Before you start

Develop goals and plan for obtaining the desired measurements.

Develop realistic scenarios

https://stocksnap.io/author/1949 Startup Stock Photos

Page 29: How to Start Performance Testing?

1. Gather requirements

https://stocksnap.io/author/5257 Lukasz Kowalewski

Page 30: How to Start Performance Testing?

2. Set your goals

https://stocksnap.io/author/16572 Chen YiZhou

Page 31: How to Start Performance Testing?

3. Estimate

https://stocksnap.io/user/saumya04 Saumya Rastogi

Page 32: How to Start Performance Testing?

https://stocksnap.io/author/1949 Startup Stock Photos

Estimation - part 1.

- We anticipate 50,000 users a day?

- What is a user? User is a visit.

- What is a day? 8 hours

- Average user visit: 10 minutes

- Session timeout: 15 minutes

- Average pages per visit: 5

- Peak time factor: 5

- Requests per page: 6

Page 33: How to Start Performance Testing?

https://stocksnap.io/author/1949 Startup Stock Photos

Estimation - part 2.

50,000 users per day / 8 hour day = … ~= 1.7 users/second

Peak hours: 1.7 users/second * 5 ~= 8.5 users/second

During visit: 8.5 users/second * 10 minutes ~= 5,100 users5,100 users * 5 pages per visit = 25,500 pages per 10 minute visit6 requests per page * (25,500 / 10) / 60 =

THROUGHPUT = 255 requests/second

Page 34: How to Start Performance Testing?

4. Performance testing tools

JMeter.

https://stocksnap.io/author/6696 Peter Belch

Page 35: How to Start Performance Testing?

JMeter - Getting started

Test Plan

Test Group

Samplers

Logic controllers

Page 36: How to Start Performance Testing?

Listeners

Page 37: How to Start Performance Testing?

Assertions

Response Assertion

Duration Assertion

Size Assertion

Page 38: How to Start Performance Testing?

Distributed testing

Page 39: How to Start Performance Testing?

Plugins

Stepping Thread Group

Ultimate Thread Group

Page 40: How to Start Performance Testing?

Others

Sending JSON using HTTP

HTTP Cookie Manager

CSV File Reading

Timers

Page 41: How to Start Performance Testing?

Takeaways

https://stocksnap.io/author/63 Pawel Kadysz

Page 42: How to Start Performance Testing?

JMeter Best Practices

https://stocksnap.io/author/402 Skitter Photo

Page 43: How to Start Performance Testing?

- Generate reports after test run.

- Use CSV output rather than XML

- Use distributed (remote) testing

- Do not use XPath extractor

- Do not use Regular Expression Extractor with checked Body (unescaped)

- Use latest version of JMeter

- Use Cookie Manager for each Thread Group

- Read data from CSV files

- Use variables

- Use non-GUI mode

- …

- http://testerfenster.com/blog/jmeter-tutorials-best-practices/

https://stocksnap.io/author/1949 Startup Stock Photos

Page 44: How to Start Performance Testing?

Test script

https://stocksnap.io/author/403 Jeffrey Betts

-

Page 45: How to Start Performance Testing?

- Provide a warm-up period to initiate the environment

- Obtain measurements within a steady-state period

- Verify error-free test execution

- Drive same workload between runs

- Capture measurement without impacting performances

https://stocksnap.io/author/1949 Startup Stock Photos

Page 46: How to Start Performance Testing?

Use performance terminology consistently.

https://stocksnap.io/author/5678 Piotr Lohunko

Page 47: How to Start Performance Testing?

Your performance test is as good as data it produces.

https://stocksnap.io/author/4440 Luis Llerena

Page 48: How to Start Performance Testing?

Resources

Page 49: How to Start Performance Testing?

Resources

Performance Testing Guidance for Web Applications Microsoft Corporation

Performance Testing with Jmeter - Second Edition Bayo Erinle

Performance Analysis for Java Web Sites Stacy Joines, Ruth Willenborg, Ken Hygh

https://blazemeter.com/blog/

Page 50: How to Start Performance Testing?

http://www.testerfenster.comhttp://testerfenster.com/blog/jmeter-tutorials/

Page 51: How to Start Performance Testing?

Thank You

Nebojsa Videnov

www.testerfenster.com

@TesterFenster