SlideShare ist ein Scribd-Unternehmen logo
1 von 40
Downloaden Sie, um offline zu lesen
Website Latency Diagnostics
           alex.burciu @ amazon.com
                      bad robot.
Agenda
•   Web Performance Optimization
•   Measuring Web Latency
•   Latency Monitoring and Analysis
•   Testing Latency
Web Performance Optimization
• Customer satisfaction & loyalty
   – White page of death
   – “World Wide Wait”

• Faster pages = longer sessions
   – Sales opportunities
   – Ads impressions

• Competitive Advantage
   – Better customer experience
   – Factor in SEO rankings
Latency Metrics
• Understand what you’re optimizing and quantify impact.

   – serverRenderTime (webserver render time)
      • time delay on the webserver since receiving the HTTP
         request to when generating and emitting the last byte of
         content to the client.

   – clientPageLoaded (browser render time)
       • time delay spent on the browser since receiving the first
         HTML response byte to when the DOM load event is fired.

   – clickToPageLoaded (complete rendering time)
       • time delay experienced by the customer since when
         initiating navigation to when the page loaded.
Metrics Relations

(?) clickToPageLoaded =
        serverRenderTime + clientPageLoaded



(?) serverRenderTime > clientPageLoaded
Browser-webserver Interaction
                     serverRenderTime




Click                                                             PL
        Unload     RTT                  Response Transfer   DOM
        Redirect
        Cache                                clientPageLoaded
        DNS
        TCP
        SSL
HTTP Flushing
                     serverRenderTime




Click                                                      PL
        Unload     RTT           Response transfer   DOM
        Redirect
        Cache                        clientPageLoaded
        DNS
        TCP
        SSL
HTTP Caching




        clientPageLoaded
Click                      PL
        Unload     DOM
        Redirect
        Cache
Back-Forward Rendering Cache




Click              PL
        Redirect
        Cache
Pre-rendering
                serverRenderTime




                                                       PL   Click
   Unload     RTT                  Transfer   DOM
   Redirect
   Cache                            clientPageLoaded
   DNS
   TCP
   SSL
Navigation Timing (pre-request)




Click            Redirect   Cache   DNS   TCP Connection   SSL   Req...
        Unload
Navigation Timing (pre-request)

        navigationStart                    fetchStart


          unloadEventStart                          domainLookupStart              secureConnectionStart

                          redirectStart                       connectStart                   requestStart



Click       Unload          Redirect        Cache       DNS       TCP Connection      SSL      Req...




                          redirectEnd                                        connectEnd

unloadEventEnd                            domainLookupEnd
Navigation Timing (post-request)




           Response
 Request              DOM Processing   onLoad   PL
Navigation Timing (post-request)

                               domLoading


requestStart                    domInteractive

               responseStart       domContentLoadedEventStart              loadEventStart



  Request         Response                  DOM Processing                   onLoad         PL




               responseEnd                                   domComplete

      domContentLoadedEventEnd                                       loadEventEnd
PageLoad Lifetime
                                                                  navigationStart
                                                                  redirect
                                                                  fetchStart
                                                                  connect
                                                                  dns
                                                                  requestStart
                                                                  responseStart
                                                                  domLoading
                                                                  unloadEvent
                                                                  domInteractive
                                                                  domContentLoaded
                                                                  domComplete
                                                                  loadEvent




0      2,000   4,000   6,000   8,000   10,000   12,000   14,000
Navigation Timing JavaScript API
>> window.performance.timing
PerformanceTiming
     connectEnd: 1344530318281
     connectStart: 1344530318281
     domComplete: 1344530330212
     domContentLoadedEventEnd: 1344530321367
     domContentLoadedEventStart: 1344530320211
     domInteractive: 1344530320048
     domLoading: 1344530318567
     domainLookupEnd: 1344530317143
     domainLookupStart: 1344530317143
     fetchStart: 1344530318281
     loadEventEnd: 1344530330214
     loadEventStart: 1344530330212
     navigationStart: 1344530317144
     redirectEnd: 1344530318281
     redirectStart: 1344530317149
     requestStart: 1344530318283
     responseEnd: 1344530319479
     responseStart: 1344530318566
     secureConnectionStart: 0
     unloadEventEnd: 1344530319045
     unloadEventStart: 1344530318567
Page Responsiveness
   clickToFirstByte = responseStart - navigationStart
 Influencing                       Backend                 Front-end
               Network   Server                 Browser
    factor                        Application             Application
Unload                                            ✓           ✓
Redirect         ✓        ✓           ✓
Cache                                 ✓           ✓
DNS              ✓        ✓
Connection       ✓        ✓                       ✓           ✓
SSL              ✓                                ✓
Request          ✓        ✓                       ✓
Response         ✓        ✓           ✓
End-to-end Latency
   clickToPageLoaded = loadEventEnd - navigationStart
 Influencing                       Backend                 Front-end
               Network   Server                 Browser
    factor                        Application             Application
clickToFB        ✓        ✓           ✓           ✓           ✓
DOM
                 ✓        ✓           ✓           ✓           ✓
Interactive
DOM
Content          ✓                                ✓           ✓
Loaded
DOM
                 ✓                                ✓           ✓
Complete
DOM Load
                                                  ✓           ✓
Event
Testing Web Performance
Synthetic Benchmarking
   – Generated traffic
   – Limited context
                         Real Users Monitoring
   – Subset of pages
                            – Prod traffic
   – On-demand
                            – Context-aware
   – Expensive
                            – All visited pages
                            – Continuous
                            – Cheap
Average Daily Latency in 3 months
Average Daily Latency in 3 months
Avg Daily Latency vs Traffic
Avg Daily Latency vs Traffic
Avg Hourly Latency vs Traffic
Prev Week Avg Hourly Latency &Traffic
Percentile Metrics
• P(x) = variable value for which x% of the variables are
  smaller
    P25 = first quartile (Q1)
    P50 = median (Q2)
    P75 = third quartile (Q3)

• Example
   – 10, 770, 40, 60, 50, 880, 9999, 30, 30, 20, 10
   – 10, 10, 20, 30, 30, 40, 50, 60, 770, 880, 9999

• Average vs P50: 1,081 > 40
Prev Week Hourly Latency Percentiles
Understats and overstats
• The inverse of a percentile.

• Percentiles
   – Constant percentage (e.g. 50%)
   – Variable measurement (e.g. latency in ms)

• Understatistics and overstatistics
   – Constant measurement (e.g. latency <1000ms)
   – Variable percentage (e.g. percentage of hits)

• Understat x = percentage of hits with latency under x ms
Prev Week Traffic% under 2 seconds
Prev Week Traffic% under 2 seconds
Avg vs P50 5-minute Latency
P50 for components before response
P50 for components after response
domContentLoaded per browser
DOM Content Loaded
   domLoadingToDomContentLoaded =
       domContentLoadedEventStart - domLoading
 Influencing                       Backend                 Front-end
               Network   Server                 Browser
    Factor                        Application             Application
DOM
Content          ✓                                ✓           ✓
Loaded
Root Cause: Content Change
  Date                    Press Release Title
            Updated Amazon Cloud Player Includes New Scan
7/31/2012   and Match Technology, Free Audio Quality
            Upgrades, and More
            Amazon.com Announces Second Quarter Sales
7/26/2012
            up 29% to $12.83 Billion
            Amazon Launches Innovative New Education
            Initiative, Paying 95% of Tuition Costs for
7/23/2012
            Employees to Pursue Their Aspirations – Whether
            at Amazon, or in Another Industry
            Amazon.com Books Editors Announce the Big Fall
7/23/2012
            Books Preview
            On Prime Instant Video First: Amazon Announces
            Digital Video License Agreement with Warner
7/20/2012   Bros. Domestic Television Distribution, Bringing
            Acclaimed TV Shows Exclusively to Kindle Fire
            and Prime Customers
            Amazon Web Services Introduces New Amazon            “Jeff Letter”
7/19/2012
            EC2 High I/O Instance Type                         on Gateway Page
            Amazon.com to Webcast Second Quarter 2012
7/12/2012
            Financial Results Conference Call
Example Latency Root Causes
A/B Latency Testing
Key Takeaways
• Invest in Latency Monitoring
   – 80% of the latency is on the client
   – Navigation Timing cross-browser API

• Browser rendering is complex
   – Latency easily influenced by context
   – Lab traffic is different from the mix from real customers

• Look at your data
   – Average poorly represents a population
   – Control releases using A/B testing
Q&A




  “Premature optimization is the root of all evil.”
                          – Donald Knuth

Weitere ähnliche Inhalte

Was ist angesagt?

Interactive web. O rly?
Interactive web. O rly?Interactive web. O rly?
Interactive web. O rly?
timbc
 
크롬의고성능네트워킹
크롬의고성능네트워킹크롬의고성능네트워킹
크롬의고성능네트워킹
Juhui Park
 
Стек Linux HTTPS/TCP/IP для защиты от HTTP-DDoS-атак
Стек Linux HTTPS/TCP/IP для защиты от HTTP-DDoS-атакСтек Linux HTTPS/TCP/IP для защиты от HTTP-DDoS-атак
Стек Linux HTTPS/TCP/IP для защиты от HTTP-DDoS-атак
Positive Hack Days
 
Presentation (PowerPoint File)
Presentation (PowerPoint File)Presentation (PowerPoint File)
Presentation (PowerPoint File)
webhostingguy
 
Uploadify v2.1.0 manual
Uploadify v2.1.0 manualUploadify v2.1.0 manual
Uploadify v2.1.0 manual
guest6b3d83
 

Was ist angesagt? (14)

Interactive web. O rly?
Interactive web. O rly?Interactive web. O rly?
Interactive web. O rly?
 
크롬의고성능네트워킹
크롬의고성능네트워킹크롬의고성능네트워킹
크롬의고성능네트워킹
 
Стек Linux HTTPS/TCP/IP для защиты от HTTP-DDoS-атак
Стек Linux HTTPS/TCP/IP для защиты от HTTP-DDoS-атакСтек Linux HTTPS/TCP/IP для защиты от HTTP-DDoS-атак
Стек Linux HTTPS/TCP/IP для защиты от HTTP-DDoS-атак
 
Service workers - Velocity 2016 Training
Service workers - Velocity 2016 TrainingService workers - Velocity 2016 Training
Service workers - Velocity 2016 Training
 
Grokking the REST Architectural Style
Grokking the REST Architectural StyleGrokking the REST Architectural Style
Grokking the REST Architectural Style
 
Presentation (PowerPoint File)
Presentation (PowerPoint File)Presentation (PowerPoint File)
Presentation (PowerPoint File)
 
Revisiting HTTP/2
Revisiting HTTP/2Revisiting HTTP/2
Revisiting HTTP/2
 
Web Services Introduction
Web Services IntroductionWeb Services Introduction
Web Services Introduction
 
Promise of Push (HTTP/2 Web Performance)
Promise of Push (HTTP/2 Web Performance)Promise of Push (HTTP/2 Web Performance)
Promise of Push (HTTP/2 Web Performance)
 
Performance Evaluation of XMPP on the Web
Performance Evaluation of XMPP on the WebPerformance Evaluation of XMPP on the Web
Performance Evaluation of XMPP on the Web
 
HTTP/2: What no one is telling you
HTTP/2: What no one is telling youHTTP/2: What no one is telling you
HTTP/2: What no one is telling you
 
Memento: Time Travel for the Web
Memento: Time Travel for the WebMemento: Time Travel for the Web
Memento: Time Travel for the Web
 
Powering your website with realtime data
Powering your website with realtime dataPowering your website with realtime data
Powering your website with realtime data
 
Uploadify v2.1.0 manual
Uploadify v2.1.0 manualUploadify v2.1.0 manual
Uploadify v2.1.0 manual
 

Ähnlich wie Website Latency Diagnostics

Essential for a great web experience e briks infotech
Essential for a great web experience   e briks infotechEssential for a great web experience   e briks infotech
Essential for a great web experience e briks infotech
ebriksinfotech
 
Aditya - Hacking Client Side Insecurities - ClubHack2008
Aditya - Hacking Client Side Insecurities - ClubHack2008Aditya - Hacking Client Side Insecurities - ClubHack2008
Aditya - Hacking Client Side Insecurities - ClubHack2008
ClubHack
 

Ähnlich wie Website Latency Diagnostics (20)

Metrics, Metrics Everywhere (but where the heck do you start?)
Metrics, Metrics Everywhere (but where the heck do you start?)Metrics, Metrics Everywhere (but where the heck do you start?)
Metrics, Metrics Everywhere (but where the heck do you start?)
 
Metrics, Metrics Everywhere (but where the heck do you start?)
Metrics, Metrics Everywhere (but where the heck do you start?)Metrics, Metrics Everywhere (but where the heck do you start?)
Metrics, Metrics Everywhere (but where the heck do you start?)
 
Metrics, metrics everywhere (but where the heck do you start?)
Metrics, metrics everywhere (but where the heck do you start?)Metrics, metrics everywhere (but where the heck do you start?)
Metrics, metrics everywhere (but where the heck do you start?)
 
Metrics, metrics everywhere (but where the heck do you start?)
Metrics, metrics everywhere (but where the heck do you start?) Metrics, metrics everywhere (but where the heck do you start?)
Metrics, metrics everywhere (but where the heck do you start?)
 
Velocity NYC: Metrics, metrics everywhere (but where the heck do you start?)
Velocity NYC: Metrics, metrics everywhere (but where the heck do you start?)Velocity NYC: Metrics, metrics everywhere (but where the heck do you start?)
Velocity NYC: Metrics, metrics everywhere (but where the heck do you start?)
 
Metrics, metrics everywhere (but where the heck do you start?)
Metrics, metrics everywhere (but where the heck do you start?)Metrics, metrics everywhere (but where the heck do you start?)
Metrics, metrics everywhere (but where the heck do you start?)
 
AWS Summit London 2014 | Dynamic Content Acceleration (300)
AWS Summit London 2014 | Dynamic Content Acceleration (300)AWS Summit London 2014 | Dynamic Content Acceleration (300)
AWS Summit London 2014 | Dynamic Content Acceleration (300)
 
Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront ...
Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront ...Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront ...
Dynamic Content Acceleration: Lightning Fast Web Apps with Amazon CloudFront ...
 
Dynamic Content Acceleration: Amazon CloudFront and Amazon Route 53 (ARC309) ...
Dynamic Content Acceleration: Amazon CloudFront and Amazon Route 53 (ARC309) ...Dynamic Content Acceleration: Amazon CloudFront and Amazon Route 53 (ARC309) ...
Dynamic Content Acceleration: Amazon CloudFront and Amazon Route 53 (ARC309) ...
 
DEF CON 27 - GERALD DOUSSOT AND ROGER MEYER - state of dns rebinding attack ...
DEF CON 27 - GERALD DOUSSOT  AND ROGER MEYER - state of dns rebinding attack ...DEF CON 27 - GERALD DOUSSOT  AND ROGER MEYER - state of dns rebinding attack ...
DEF CON 27 - GERALD DOUSSOT AND ROGER MEYER - state of dns rebinding attack ...
 
Speed is Essential for a Great Web Experience (oredev)
Speed is Essential for a Great Web Experience (oredev)Speed is Essential for a Great Web Experience (oredev)
Speed is Essential for a Great Web Experience (oredev)
 
Essential for a great web experience e briks infotech
Essential for a great web experience   e briks infotechEssential for a great web experience   e briks infotech
Essential for a great web experience e briks infotech
 
Server-Side Programming Primer
Server-Side Programming PrimerServer-Side Programming Primer
Server-Side Programming Primer
 
WebSocket protocol
WebSocket protocolWebSocket protocol
WebSocket protocol
 
Implementing Early Hints in Chrome - Approaches and Challenges
Implementing Early Hints in Chrome - Approaches and ChallengesImplementing Early Hints in Chrome - Approaches and Challenges
Implementing Early Hints in Chrome - Approaches and Challenges
 
Aditya - Hacking Client Side Insecurities - ClubHack2008
Aditya - Hacking Client Side Insecurities - ClubHack2008Aditya - Hacking Client Side Insecurities - ClubHack2008
Aditya - Hacking Client Side Insecurities - ClubHack2008
 
Comet from JavaOne 2008
Comet from JavaOne 2008Comet from JavaOne 2008
Comet from JavaOne 2008
 
Performance analysisclass
Performance analysisclassPerformance analysisclass
Performance analysisclass
 
Growing X20 without spending an extra penny on hosting
Growing X20 without spending an extra penny on hostingGrowing X20 without spending an extra penny on hosting
Growing X20 without spending an extra penny on hosting
 
ENSURING FAST AND SECURE GAMING APPLICATION DOWNLOADS GLOBALLY
ENSURING FAST AND SECURE GAMING APPLICATION DOWNLOADS GLOBALLYENSURING FAST AND SECURE GAMING APPLICATION DOWNLOADS GLOBALLY
ENSURING FAST AND SECURE GAMING APPLICATION DOWNLOADS GLOBALLY
 

Kürzlich hochgeladen

Kürzlich hochgeladen (20)

Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 

Website Latency Diagnostics

  • 1. Website Latency Diagnostics alex.burciu @ amazon.com bad robot.
  • 2. Agenda • Web Performance Optimization • Measuring Web Latency • Latency Monitoring and Analysis • Testing Latency
  • 3. Web Performance Optimization • Customer satisfaction & loyalty – White page of death – “World Wide Wait” • Faster pages = longer sessions – Sales opportunities – Ads impressions • Competitive Advantage – Better customer experience – Factor in SEO rankings
  • 4. Latency Metrics • Understand what you’re optimizing and quantify impact. – serverRenderTime (webserver render time) • time delay on the webserver since receiving the HTTP request to when generating and emitting the last byte of content to the client. – clientPageLoaded (browser render time) • time delay spent on the browser since receiving the first HTML response byte to when the DOM load event is fired. – clickToPageLoaded (complete rendering time) • time delay experienced by the customer since when initiating navigation to when the page loaded.
  • 5. Metrics Relations (?) clickToPageLoaded = serverRenderTime + clientPageLoaded (?) serverRenderTime > clientPageLoaded
  • 6. Browser-webserver Interaction serverRenderTime Click PL Unload RTT Response Transfer DOM Redirect Cache clientPageLoaded DNS TCP SSL
  • 7. HTTP Flushing serverRenderTime Click PL Unload RTT Response transfer DOM Redirect Cache clientPageLoaded DNS TCP SSL
  • 8. HTTP Caching clientPageLoaded Click PL Unload DOM Redirect Cache
  • 10. Pre-rendering serverRenderTime PL Click Unload RTT Transfer DOM Redirect Cache clientPageLoaded DNS TCP SSL
  • 11. Navigation Timing (pre-request) Click Redirect Cache DNS TCP Connection SSL Req... Unload
  • 12. Navigation Timing (pre-request) navigationStart fetchStart unloadEventStart domainLookupStart secureConnectionStart redirectStart connectStart requestStart Click Unload Redirect Cache DNS TCP Connection SSL Req... redirectEnd connectEnd unloadEventEnd domainLookupEnd
  • 13. Navigation Timing (post-request) Response Request DOM Processing onLoad PL
  • 14. Navigation Timing (post-request) domLoading requestStart domInteractive responseStart domContentLoadedEventStart loadEventStart Request Response DOM Processing onLoad PL responseEnd domComplete domContentLoadedEventEnd loadEventEnd
  • 15. PageLoad Lifetime navigationStart redirect fetchStart connect dns requestStart responseStart domLoading unloadEvent domInteractive domContentLoaded domComplete loadEvent 0 2,000 4,000 6,000 8,000 10,000 12,000 14,000
  • 16. Navigation Timing JavaScript API >> window.performance.timing PerformanceTiming connectEnd: 1344530318281 connectStart: 1344530318281 domComplete: 1344530330212 domContentLoadedEventEnd: 1344530321367 domContentLoadedEventStart: 1344530320211 domInteractive: 1344530320048 domLoading: 1344530318567 domainLookupEnd: 1344530317143 domainLookupStart: 1344530317143 fetchStart: 1344530318281 loadEventEnd: 1344530330214 loadEventStart: 1344530330212 navigationStart: 1344530317144 redirectEnd: 1344530318281 redirectStart: 1344530317149 requestStart: 1344530318283 responseEnd: 1344530319479 responseStart: 1344530318566 secureConnectionStart: 0 unloadEventEnd: 1344530319045 unloadEventStart: 1344530318567
  • 17. Page Responsiveness clickToFirstByte = responseStart - navigationStart Influencing Backend Front-end Network Server Browser factor Application Application Unload ✓ ✓ Redirect ✓ ✓ ✓ Cache ✓ ✓ DNS ✓ ✓ Connection ✓ ✓ ✓ ✓ SSL ✓ ✓ Request ✓ ✓ ✓ Response ✓ ✓ ✓
  • 18. End-to-end Latency clickToPageLoaded = loadEventEnd - navigationStart Influencing Backend Front-end Network Server Browser factor Application Application clickToFB ✓ ✓ ✓ ✓ ✓ DOM ✓ ✓ ✓ ✓ ✓ Interactive DOM Content ✓ ✓ ✓ Loaded DOM ✓ ✓ ✓ Complete DOM Load ✓ ✓ Event
  • 19. Testing Web Performance Synthetic Benchmarking – Generated traffic – Limited context Real Users Monitoring – Subset of pages – Prod traffic – On-demand – Context-aware – Expensive – All visited pages – Continuous – Cheap
  • 20. Average Daily Latency in 3 months
  • 21. Average Daily Latency in 3 months
  • 22. Avg Daily Latency vs Traffic
  • 23. Avg Daily Latency vs Traffic
  • 24. Avg Hourly Latency vs Traffic
  • 25. Prev Week Avg Hourly Latency &Traffic
  • 26. Percentile Metrics • P(x) = variable value for which x% of the variables are smaller P25 = first quartile (Q1) P50 = median (Q2) P75 = third quartile (Q3) • Example – 10, 770, 40, 60, 50, 880, 9999, 30, 30, 20, 10 – 10, 10, 20, 30, 30, 40, 50, 60, 770, 880, 9999 • Average vs P50: 1,081 > 40
  • 27. Prev Week Hourly Latency Percentiles
  • 28. Understats and overstats • The inverse of a percentile. • Percentiles – Constant percentage (e.g. 50%) – Variable measurement (e.g. latency in ms) • Understatistics and overstatistics – Constant measurement (e.g. latency <1000ms) – Variable percentage (e.g. percentage of hits) • Understat x = percentage of hits with latency under x ms
  • 29. Prev Week Traffic% under 2 seconds
  • 30. Prev Week Traffic% under 2 seconds
  • 31. Avg vs P50 5-minute Latency
  • 32. P50 for components before response
  • 33. P50 for components after response
  • 35. DOM Content Loaded domLoadingToDomContentLoaded = domContentLoadedEventStart - domLoading Influencing Backend Front-end Network Server Browser Factor Application Application DOM Content ✓ ✓ ✓ Loaded
  • 36. Root Cause: Content Change Date Press Release Title Updated Amazon Cloud Player Includes New Scan 7/31/2012 and Match Technology, Free Audio Quality Upgrades, and More Amazon.com Announces Second Quarter Sales 7/26/2012 up 29% to $12.83 Billion Amazon Launches Innovative New Education Initiative, Paying 95% of Tuition Costs for 7/23/2012 Employees to Pursue Their Aspirations – Whether at Amazon, or in Another Industry Amazon.com Books Editors Announce the Big Fall 7/23/2012 Books Preview On Prime Instant Video First: Amazon Announces Digital Video License Agreement with Warner 7/20/2012 Bros. Domestic Television Distribution, Bringing Acclaimed TV Shows Exclusively to Kindle Fire and Prime Customers Amazon Web Services Introduces New Amazon “Jeff Letter” 7/19/2012 EC2 High I/O Instance Type on Gateway Page Amazon.com to Webcast Second Quarter 2012 7/12/2012 Financial Results Conference Call
  • 39. Key Takeaways • Invest in Latency Monitoring – 80% of the latency is on the client – Navigation Timing cross-browser API • Browser rendering is complex – Latency easily influenced by context – Lab traffic is different from the mix from real customers • Look at your data – Average poorly represents a population – Control releases using A/B testing
  • 40. Q&A “Premature optimization is the root of all evil.” – Donald Knuth