continuous performance testing: why you should care

48
blackfire.io @blackfireio #blackfireio Continuous Performance Testing > Why you should care

Upload: christophe-dujarric

Post on 14-Apr-2017

974 views

Category:

Software


0 download

TRANSCRIPT

Page 1: Continuous performance testing: Why you should care

blackfire.io @blackfireio #blackfireio

Continuous Performance Testing> Why you should care

Page 2: Continuous performance testing: Why you should care

blackfire.io @blackfireio #blackfireio

Christophe Dujarric @Chris_Dujarric Product guy. Loves simple things that solve real problems.

Paris, France

Blackfire.io/SensioLabs

christophedujarric.wordpress.com

/christophedujarric

Page 3: Continuous performance testing: Why you should care

blackfire.io @blackfireio #blackfireio

Page 4: Continuous performance testing: Why you should care

Reason #1

Money!

Page 5: Continuous performance testing: Why you should care

-100ms +1%revenue -2.2s +15%

downloads -400ms+9%traffic

Page 6: Continuous performance testing: Why you should care

blackfire.io @blackfireio #blackfireio

Application Perfomance……Monitoring?

Page 7: Continuous performance testing: Why you should care

blackfire.io @blackfireio #blackfireio

Weather conditions

Third party services

Your Code

InfrastructuresFront-end

Page 8: Continuous performance testing: Why you should care

blackfire.io @blackfireio #blackfireio

https://www.flickr.com/photos/guiseiz/6094701062

Wall Clock Time

Wall Time = CPU + I/O

Page 9: Continuous performance testing: Why you should care

blackfire.io @blackfireio #blackfireio

function foo(){ bar();

echo 'foo';}

foo();

Inclusive Time

Page 10: Continuous performance testing: Why you should care

blackfire.io @blackfireio #blackfireio

function foo(){ bar();

echo 'foo';}

foo();

Exclusive Time

Page 11: Continuous performance testing: Why you should care

blackfire.io @blackfireio #blackfireio

I/O= Network + Disk

Page 12: Continuous performance testing: Why you should care

blackfire.io @blackfireio #blackfireio

Page 13: Continuous performance testing: Why you should care

Business logic is key

Page 14: Continuous performance testing: Why you should care

blackfire.io @blackfireio #blackfireio

gc_disable();

Improving Composer

up to 90% faster

Page 15: Continuous performance testing: Why you should care

Reason #2Continuous attention to technical excellence and good design enhances agility.

Agile Manifesto

Page 16: Continuous performance testing: Why you should care

From a Technology to a Product

Page 17: Continuous performance testing: Why you should care

blackfire.io @blackfireio #blackfireio

Monitoring

Benchmarking

Load-testing

Profiling?

Page 18: Continuous performance testing: Why you should care

blackfire.io @blackfireio #blackfireio

Measuring server response to simulated demand

Mainly Open Source tools

Load testing

Bees with Machine Guns

Page 19: Continuous performance testing: Why you should care

blackfire.io @blackfireio #blackfireio

Assess the relative performance of servers

Benchmarking

SiegeHttpPerf

Apache Bench

Page 20: Continuous performance testing: Why you should care

blackfire.io @blackfireio #blackfireio

Real traffic tracking | Crash reports | R.U.M.

Monitoring

Page 21: Continuous performance testing: Why you should care

blackfire.io @blackfireio #blackfireio

Detailed insights on code performance

Open Source/legacy tools

Profiling

XHProf

Page 22: Continuous performance testing: Why you should care

blackfire.io @blackfireio #blackfireio

Page 23: Continuous performance testing: Why you should care

abandon a website that takes more than 3 seconds to load

40% of users

Page 24: Continuous performance testing: Why you should care

blackfire.io @blackfireio #blackfireio

Solving issues in production costs a lot more than solving them in development

Page 25: Continuous performance testing: Why you should care

blackfire.io @blackfireio #blackfireio

Agile and Continuous Integration/Delivery thrive to test and automate testing but no tool could

do that for code performance

Page 26: Continuous performance testing: Why you should care

We want performance to become a major component of Continuous Integration/Delivery

and prevent issues before they occur in production.

thanks to tools which will continuously and automatically test and improve

application performance,

Page 27: Continuous performance testing: Why you should care

Reason #3

Because now you can.

Page 28: Continuous performance testing: Why you should care

Step 1: Set your objectives

Page 29: Continuous performance testing: Why you should care

blackfire.io @blackfireio #blackfireio

Performance is business

T100ms 400ms

Page 30: Continuous performance testing: Why you should care

blackfire.io @blackfireio #blackfireio

Pages should be fast

Pages should be light

Pages should not do too many SQL queries

Pages should not become slower

Write it like you think of it

Page 31: Continuous performance testing: Why you should care

blackfire.io @blackfireio #blackfireio

# ~/workspace/project/.blackfire.yml tests: "Pages should be fast enough": path: "/.*" assertions: - "main.wall_time < 80ms" - "main.memory < 8M" - "main.peak_memory < 8M" - "main.io < 10ms" "Pages should not do too many SQL queries": path: "/.*" assertions: - "metrics.sql.queries.count <= 4" "Pages should be light": path: "/.*" assertions: - "metrics.output.network_out < 30KB" "Pages should not become slower": path: "/.*" assertions: - "percent(main.wall_time) < 10%" - "diff(metrics.sql.queries.count) < 2"

.blackfire.yml

Page 32: Continuous performance testing: Why you should care

Step 2: Circumscribe the issues

Page 33: Continuous performance testing: Why you should care

blackfire.io @blackfireio #blackfireio

Page 34: Continuous performance testing: Why you should care

blackfire.io @blackfireio #blackfireio

Profile visualization

Page 35: Continuous performance testing: Why you should care

blackfire.io @blackfireio #blackfireio

Page 36: Continuous performance testing: Why you should care

Step 3: Fix and check

Page 37: Continuous performance testing: Why you should care

blackfire.io @blackfireio #blackfireio

composer install --optimize-autoloader

Page 38: Continuous performance testing: Why you should care

blackfire.io @blackfireio #blackfireio

Page 39: Continuous performance testing: Why you should care

Step 4: Make sure it won’t happen

(again)

Page 40: Continuous performance testing: Why you should care

blackfire.io @blackfireio #blackfireio

TDD?

Page 41: Continuous performance testing: Why you should care

blackfire.io @blackfireio #blackfireio

# ~/workspace/project/.blackfire.yml tests: "Pages should be fast enough": path: "/.*" assertions: - "main.wall_time < 80ms" - "main.memory < 8M" - "main.peak_memory < 8M" - "main.io < 10ms" - "metrics.composer.file_lookups.count == 0"

metrics: composer.file_lookups: label: Composer File Lookups layer: ~ matching_calls: php: - callee: =Composer\Autoload\ClassLoader::findFileWithExtension

Custom Metrics

Page 42: Continuous performance testing: Why you should care

blackfire.io @blackfireio #blackfireio

Page 43: Continuous performance testing: Why you should care

Step 5: QA everywhere

Page 44: Continuous performance testing: Why you should care

blackfire.io @blackfireio #blackfireio

Continuous Deployment

Several times a day

Page 45: Continuous performance testing: Why you should care

blackfire.io @blackfireio #blackfireio

Completed 26 sprints

Marked 700+ stories and tasks as Done

rolled out 220 prod releases of the website

Merged 2,260 pull requests

In a year, we

Avg.

Page 46: Continuous performance testing: Why you should care

blackfire.io @blackfireio #blackfireio

Page 47: Continuous performance testing: Why you should care

Christophe Dujarric - Product Manager [email protected]

@Chris_Dujarric

Fire up your PHP Apps Performance

Page 48: Continuous performance testing: Why you should care