Top Banner
Tracking Performance Patrick Meenan @patmeenan
62

Tracking Performance - Velocity NYC 2013

Jan 27, 2015

Download

Technology

Patrick Meenan

Slides from Velocity NYC 2013 presentation on measuring and tracking web performance.
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: Tracking Performance - Velocity NYC 2013

Tracking PerformancePatrick Meenan@patmeenan

Page 2: Tracking Performance - Velocity NYC 2013

Slides will be available

http://www.slideshare.net/patrickmeenan

Page 3: Tracking Performance - Velocity NYC 2013

Introducing shop-de-nile.com

Page 4: Tracking Performance - Velocity NYC 2013

System Architecture

Product DB

Load Balancer

Load Balancer

Web Server (App)

Web Server (App)

Web Server (App)

Web Server (App)

Web Server (Static)

Web Server (Static)

SOLR FT Search

ProductImages

Reviews DB

Page 5: Tracking Performance - Velocity NYC 2013
Page 6: Tracking Performance - Velocity NYC 2013

Us Them

Page 8: Tracking Performance - Velocity NYC 2013

New System Architecture

Product DB

Load Balancer

Load Balancer

Web Server (App)

Web Server (App)

Web Server (App)

Web Server (App)

Web Server (Static)

Web Server (Static)

SOLR FT Search

ProductImages

Reviews DB

Varnish

Varnish

MemcacheMemcache

Memcache

Page 9: Tracking Performance - Velocity NYC 2013
Page 10: Tracking Performance - Velocity NYC 2013
Page 11: Tracking Performance - Velocity NYC 2013
Page 12: Tracking Performance - Velocity NYC 2013

Testing Plan● 14 Locations● 3 “Representative” Pages

○ Landing Page○ Search Results Page○ Product Listing Page

● 1 Browser● First View Only● Every 5 Minutes (12 samples per hour)

Page 13: Tracking Performance - Velocity NYC 2013

12,096 Tests Per Day

Page 14: Tracking Performance - Velocity NYC 2013
Page 15: Tracking Performance - Velocity NYC 2013
Page 16: Tracking Performance - Velocity NYC 2013
Page 18: Tracking Performance - Velocity NYC 2013
Page 19: Tracking Performance - Velocity NYC 2013

CDN test plan

● Test 3 CDN’s● Over 2 Weeks● Compare against:

○ Each Other○ Local Performance○ No CDN

Page 20: Tracking Performance - Velocity NYC 2013

36,288 Tests Per Day

Page 21: Tracking Performance - Velocity NYC 2013
Page 22: Tracking Performance - Velocity NYC 2013

Re-Run Competitive Comparison

● Globally● 20 Page Loads Per Day● 3 Representative Pages● 1,680 Page Loads

Page 23: Tracking Performance - Velocity NYC 2013
Page 25: Tracking Performance - Velocity NYC 2013

Real User Monitoring (RUM)

Page 26: Tracking Performance - Velocity NYC 2013

5.28 1.38

Page 28: Tracking Performance - Velocity NYC 2013

Instrument back-endhttp://www.slideshare.net/mikebrittain/metrics-driven-engineering-at-etsy

http://codeascraft.com/

Access Logs -> logster -> statsd -> graphite

Page 29: Tracking Performance - Velocity NYC 2013

Application Performance Measurement (APM)

Page 30: Tracking Performance - Velocity NYC 2013
Page 31: Tracking Performance - Velocity NYC 2013

Cache Hits

Page 32: Tracking Performance - Velocity NYC 2013

Not no much

Page 33: Tracking Performance - Velocity NYC 2013
Page 34: Tracking Performance - Velocity NYC 2013

Testing Plan● 14 Locations● 3 “Representative” Pages

○ Landing Page○ Search Results Page○ Product Listing Page

● 1 Browser● First View Only● Every 5 Minutes (12 samples per hour)

Page 35: Tracking Performance - Velocity NYC 2013

http://www.youtube.com/watch?v=H7PJ1oeEyGg

Go buy an SSD

@crucially

Page 36: Tracking Performance - Velocity NYC 2013

New New System Architecture

Product DB (SSD)

Load Balancer

Load Balancer

Web Server (App)

Web Server (App)

Web Server (App)

Web Server (App)

Web Server (Static)

Web Server (Static)

SOLR FT Search (SSD)

ProductImages (SSD)

Reviews DB (SSD)

Varnish(SSD)

Varnish(SSD)

MemcacheMemcache

Memcache

Page 37: Tracking Performance - Velocity NYC 2013
Page 38: Tracking Performance - Velocity NYC 2013

4.58

Page 39: Tracking Performance - Velocity NYC 2013

Not matching synthetic testing

● Backbone vs last-mile● Long-tail images

Page 43: Tracking Performance - Velocity NYC 2013

Testing Plan● 14 Locations● 3 “Representative” Pages

○ Landing Page○ Search Results Page○ Product Listing Page

● 1 Browser● First View Only● Every 5 Minutes (12 samples per hour)

Images always in edge cache

Page 44: Tracking Performance - Velocity NYC 2013

New Experience Testing Plan● 14 Last-Mile Locations● 3 “Representative” Pages

○ Landing Page○ Random Search Results Page○ Random Product Listing Page

● 2 Browsers○ Desktop○ Mobile (actual device)

● First View Only● 20 Samples per day

Page 45: Tracking Performance - Velocity NYC 2013
Page 46: Tracking Performance - Velocity NYC 2013

Measured Load Times still too slow

● Social Sharing Widgets● Ads● Retargeting pixels● Analytics

All already Async and using best practices

Page 47: Tracking Performance - Velocity NYC 2013
Page 48: Tracking Performance - Velocity NYC 2013

Ummm….

● Large drop in revenue● Loss of tracking● Doesn’t “feel” significantly faster

Page 49: Tracking Performance - Velocity NYC 2013

Speed Index FTW

● Measures visual experience● Synthetic Only (WebPagetest)

Page 50: Tracking Performance - Velocity NYC 2013

Speed Index 3rd Party Evaluation

Page 51: Tracking Performance - Velocity NYC 2013

Speed Index FTW

● Measures visual experience● Synthetic Only (WebPagetest)

Page 52: Tracking Performance - Velocity NYC 2013

We got this...it’s only codeonload=”performance.mark(‘aft.Image Loaded’)”...

http://blog.patrickmeenan.com/2013/07/measuring-performance-of-user-experience.html

window.onload:● performance.getEntriesByType(“mark”)● Report latest aft.* as custom time

Page 53: Tracking Performance - Velocity NYC 2013

Roll-your-own

● Send http beacon to beacon server○ All timings as query params○ 204 or transparent 1px gif○ Log requests to access log

● IP, User Agent and Timings all in each record

● access log -> logster -> statsd -> graphite● Profit!

Page 54: Tracking Performance - Velocity NYC 2013

Google Analytics_gaq.push(['_trackTiming', 'UserTimings', 'aft', measuredTime);

Page 55: Tracking Performance - Velocity NYC 2013

Boomerang/Soasta mPulseBOOMR.plugins.RT.setTimer(‘custom0’, measuredTime);

https://gist.github.com/pmeenan/5902672

Page 56: Tracking Performance - Velocity NYC 2013

AFT vs onload

http://www.soasta.com/products/mpulse/

AFT

Median 0.932

95th Percentile 4.141

98th Percentile 7.262

onLoad

Median 2.235

95th Percentile 11.787

98th Percentile 26.72

Page 57: Tracking Performance - Velocity NYC 2013

Custom timings in WebPagetest

Page 58: Tracking Performance - Velocity NYC 2013

Where does that leave us?● Competitive testing with synthetic last-mile

○ After builds pushed to staging/prod

● Performance tracking with RUM custom measurements○ Data can be noisy○ No competitive capability (opportunity)

Page 59: Tracking Performance - Velocity NYC 2013

Where does that leave us?● Competitive testing with synthetic last-mile

○ After builds pushed to staging/prod

● Performance tracking with RUM custom measurements○ Data can be noisy○ No competitive capability (opportunity)

Page 60: Tracking Performance - Velocity NYC 2013

Synthetic testing in CI● PhantomJS + CI● WebPagetest Private Instance + CI

○ https://github.com/marcelduran/webpagetest-api● Graphing/Trending artifacts

○ httparchive○ graphite○ Show Slow○ tsviewdb

Page 61: Tracking Performance - Velocity NYC 2013

tsviewdb

https://github.com/google/tsviewdb

● Trending● Regression Detection

Page 62: Tracking Performance - Velocity NYC 2013

People will optimize for what you measure….

So measure what you want optimized.