Stress Test as a Culture

Preview:

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

Stress Testing as a Culture

@joaomdmoura gioco.pro

1,600,000,000.00 USD

1 Second

1 Second

500 msextra load time on results

500 msextra load time on results drop in traffic

20%=

0%

10%

20%

30%

40%

0 2 4 6 8 10

Loadtime in seconds

Page abandonment increase

0%

10%

20%

30%

40%

0 2 4 6 8 10

Loadtime in seconds

Page abandonment increase

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

would not return if it took longer than 4 seconds75%

“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/

Performanceper·for·mance:

execution of an action

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

Stress Testing as a Culture

?

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

largest city in the Americas

largest city in the Americas

largest city in the Americas

the most populous city of the southern hemisphere

Stress Test

15 requests 1 minute

1 requests 4 seconds

3 successfully responses

9456 ms average time of response

How to approach?

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

Set Stress Goals!

•Optimize an existing feature or asset on the page.

•Optimize an existing feature or asset on the page.

•Remove an existing feature or asset from the page.

•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.

80Golden Rule

80Golden Rule

2080Low effort big impact

2080Low effort big impact

2080Low effort big impact

Front End Back End

Mobile FirstPerformance

Billion people online Smartphones

1995 2000 2014

3.5

0%

25%

50%

75%

100%

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

No Smartphone No Internet

10 seconds on GPRS

< 500ms

Types of

StressLoad

Test

Types of

StressLoad

Performance Test

Types of StressLoad

PerformanceTest

Types ofStressLoad

Performance

Test

Stress

Clients per Second

Stress

Clients per Second Maintain Client Load

Stress

Clients per Second

Clients per Second

Maintain Client Load

Maintain Client Load

5 requestsper Second

What tools to use?

Apache Bench

Apache Bench

JMeter

Apache Bench

JMeter

Tsung

Apache Bench

JMeter

Tsung

HTTPerf

Apache Bench

JMeter

Tsung

HTTPerf

HTTPload

Apache Bench

JMeter

Tsung

HTTPerf

HTTPload

Trample

Loader.io

A free load testing service to stress test

your web-apps & apis with thousands

of concurrent connections.

10,000 clients / test

Culture!

What it means?

TDDTDD

TDDTDDBDDBDD

TDDTDDBDDBDD*DD*DD

Integrate it within your deployment process

We can do this!

And the World Cup?

3 successfully responses

9456 ms average time of response

1. Created missed indexes

2. Changed database architecture & relationships

3. Refactored tons of code

4. Background Jobs

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

Wrap up!

Wrap up!1. Set goals, stick to it

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

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

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

Open Source

ActiveModel::Serializers

Open Source

Ask me for Stickers!

RubySource

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

Recommended