130
Stress Testing as a Culture @joaomdmoura gioco.pro

Stress Test as a Culture

Embed Size (px)

DESCRIPTION

If you are working on a serious project, you want it to scale. The thing about scale is, you only focus on it once you really need it. I’m the CTO of an soccer social network based in Brazil. To put it mildly, soccer is big in my country. This summer, we focused our marketing on the World Cup, preparing our application to support as many users as possible. To do that, we had to benchmark and improve, but how could we load test? What tool should we use? Those are just some questions that I'll go through in this talk, that will show youhot to address this challenge so stress test you app.

Citation preview

Page 1: Stress Test as a Culture

Stress Testing as a Culture

@joaomdmoura gioco.pro

Page 2: Stress Test as a Culture
Page 3: Stress Test as a Culture

1,600,000,000.00 USD

Page 4: Stress Test as a Culture

1 Second

Page 5: Stress Test as a Culture

1 Second

Page 6: Stress Test as a Culture
Page 7: Stress Test as a Culture

500 msextra load time on results

Page 8: Stress Test as a Culture

500 msextra load time on results drop in traffic

20%=

Page 9: Stress Test as a Culture

0%

10%

20%

30%

40%

0 2 4 6 8 10

Loadtime in seconds

Page abandonment increase

Page 10: Stress Test as a Culture

0%

10%

20%

30%

40%

0 2 4 6 8 10

Loadtime in seconds

Page abandonment increase

Page 11: Stress Test as a Culture
Page 12: Stress Test as a Culture
Page 13: Stress Test as a Culture

expect a web page to load in 2 seconds or less47%

Page 14: Stress Test as a Culture
Page 15: Stress Test as a Culture

would not return if it took longer than 4 seconds75%

Page 16: Stress Test as a Culture

“Information stored in our short-term memory decays quickly, which is why we don’t perform as well when we have to wait (…) And after 10 seconds?

You can pretty much forget about it. Literally.” Our need for web speed: It’s about neuroscience

http://www.webperformancetoday.com/2012/03/21/neuroscience-page-speed-web-performance/

Page 17: Stress Test as a Culture

Performanceper·for·mance:

execution of an action

Page 18: Stress Test as a Culture

João M. D. Moura @joaomdmoura gioco.pro

Page 19: Stress Test as a Culture

Stress Testing as a Culture

Page 20: Stress Test as a Culture

?

Page 21: Stress Test as a Culture

Why and how increase the success rate of my application to meet the needs related to scale?

Page 22: Stress Test as a Culture
Page 23: Stress Test as a Culture
Page 24: Stress Test as a Culture
Page 25: Stress Test as a Culture
Page 26: Stress Test as a Culture

largest city in the Americas

Page 27: Stress Test as a Culture

largest city in the Americas

Page 28: Stress Test as a Culture

largest city in the Americas

the most populous city of the southern hemisphere

Page 29: Stress Test as a Culture
Page 30: Stress Test as a Culture
Page 31: Stress Test as a Culture
Page 32: Stress Test as a Culture
Page 33: Stress Test as a Culture
Page 34: Stress Test as a Culture
Page 35: Stress Test as a Culture
Page 36: Stress Test as a Culture

Stress Test

Page 37: Stress Test as a Culture

15 requests 1 minute

Page 38: Stress Test as a Culture

1 requests 4 seconds

Page 39: Stress Test as a Culture
Page 40: Stress Test as a Culture
Page 41: Stress Test as a Culture

3 successfully responses

Page 42: Stress Test as a Culture
Page 43: Stress Test as a Culture

9456 ms average time of response

Page 44: Stress Test as a Culture
Page 45: Stress Test as a Culture
Page 46: Stress Test as a Culture

How to approach?

Page 47: Stress Test as a Culture

Treat performance as a critical matter alongside design, development, and marketing.

Page 48: Stress Test as a Culture

Set Stress Goals!

Page 49: Stress Test as a Culture
Page 50: Stress Test as a Culture

•Optimize an existing feature or asset on the page.

Page 51: Stress Test as a Culture

•Optimize an existing feature or asset on the page.

•Remove an existing feature or asset from the page.

Page 52: Stress Test as a Culture

•Optimize an existing feature or asset on the page.

•Remove an existing feature or asset from the page.

•Don’t add the new feature or asset.

Page 53: Stress Test as a Culture

80Golden Rule

Page 54: Stress Test as a Culture

80Golden Rule

Page 55: Stress Test as a Culture

2080Low effort big impact

Page 56: Stress Test as a Culture

2080Low effort big impact

Page 57: Stress Test as a Culture

2080Low effort big impact

Front End Back End

Page 58: Stress Test as a Culture

Mobile FirstPerformance

Page 59: Stress Test as a Culture
Page 60: Stress Test as a Culture

Billion people online Smartphones

1995 2000 2014

3.5

Page 61: Stress Test as a Culture

0%

25%

50%

75%

100%

1995 1997 1999 2001 2003 2005 2007 2009 2011 2013 2015 2017

No Smartphone No Internet

Page 62: Stress Test as a Culture
Page 63: Stress Test as a Culture

10 seconds on GPRS

Page 64: Stress Test as a Culture

< 500ms

Page 65: Stress Test as a Culture

Types of

StressLoad

Test

Page 66: Stress Test as a Culture

Types of

StressLoad

Performance Test

Page 67: Stress Test as a Culture

Types of StressLoad

PerformanceTest

Page 68: Stress Test as a Culture

Types ofStressLoad

Performance

Test

Page 69: Stress Test as a Culture

Stress

Page 70: Stress Test as a Culture

Clients per Second

Stress

Page 71: Stress Test as a Culture

Clients per Second Maintain Client Load

Stress

Page 72: Stress Test as a Culture

Clients per Second

Page 73: Stress Test as a Culture

Clients per Second

Page 74: Stress Test as a Culture

Maintain Client Load

Page 75: Stress Test as a Culture

Maintain Client Load

Page 76: Stress Test as a Culture

5 requestsper Second

Page 77: Stress Test as a Culture

What tools to use?

Page 78: Stress Test as a Culture
Page 79: Stress Test as a Culture

Apache Bench

Page 80: Stress Test as a Culture

Apache Bench

JMeter

Page 81: Stress Test as a Culture

Apache Bench

JMeter

Tsung

Page 82: Stress Test as a Culture

Apache Bench

JMeter

Tsung

HTTPerf

Page 83: Stress Test as a Culture

Apache Bench

JMeter

Tsung

HTTPerf

HTTPload

Page 84: Stress Test as a Culture

Apache Bench

JMeter

Tsung

HTTPerf

HTTPload

Trample

Page 85: Stress Test as a Culture
Page 86: Stress Test as a Culture
Page 87: Stress Test as a Culture

Loader.io

Page 88: Stress Test as a Culture

A free load testing service to stress test

your web-apps & apis with thousands

of concurrent connections.

Page 89: Stress Test as a Culture

10,000 clients / test

Page 90: Stress Test as a Culture
Page 91: Stress Test as a Culture
Page 92: Stress Test as a Culture

Culture!

Page 93: Stress Test as a Culture

What it means?

Page 94: Stress Test as a Culture
Page 95: Stress Test as a Culture
Page 96: Stress Test as a Culture

TDDTDD

Page 97: Stress Test as a Culture

TDDTDDBDDBDD

Page 98: Stress Test as a Culture

TDDTDDBDDBDD*DD*DD

Page 99: Stress Test as a Culture

Integrate it within your deployment process

Page 100: Stress Test as a Culture

We can do this!

Page 101: Stress Test as a Culture

And the World Cup?

Page 102: Stress Test as a Culture

3 successfully responses

Page 103: Stress Test as a Culture

9456 ms average time of response

Page 104: Stress Test as a Culture

1. Created missed indexes

Page 105: Stress Test as a Culture

2. Changed database architecture & relationships

Page 106: Stress Test as a Culture

3. Refactored tons of code

Page 107: Stress Test as a Culture

4. Background Jobs

Page 108: Stress Test as a Culture

5. Cache, for real! * but do it right *

Page 109: Stress Test as a Culture
Page 110: Stress Test as a Culture
Page 111: Stress Test as a Culture
Page 112: Stress Test as a Culture
Page 113: Stress Test as a Culture
Page 114: Stress Test as a Culture
Page 115: Stress Test as a Culture
Page 116: Stress Test as a Culture
Page 117: Stress Test as a Culture
Page 118: Stress Test as a Culture
Page 119: Stress Test as a Culture

Wrap up!

Page 120: Stress Test as a Culture

Wrap up!1. Set goals, stick to it

Page 121: Stress Test as a Culture

Wrap up!1. Set goals, stick to it2. Types of tests

Page 122: Stress Test as a Culture

Wrap up!1. Set goals, stick to it2. Types of tests3. Choose a tool

Page 123: Stress Test as a Culture

Wrap up!1. Set goals, stick to it2. Types of tests3. Choose a tool4. Make it a culture

Page 124: Stress Test as a Culture
Page 125: Stress Test as a Culture

Open Source

Page 126: Stress Test as a Culture

ActiveModel::Serializers

Open Source

Page 127: Stress Test as a Culture

Ask me for Stickers!

Page 128: Stress Test as a Culture
Page 129: Stress Test as a Culture

RubySource

Page 130: Stress Test as a Culture

João M. D. Moura @joaomdmoura gioco.proThank You!