SlideShare a Scribd company logo
Getting a Grip on CDN Performance
                      Why & How
http://www.flickr.com/photos/59632563@N04/6261230701/
How many sites use a CDN?
CDN Performance in the Real World
http://www.flickr.com/photos/59632563@N04/6261230701/
How we measure CDN performance

Real User Monitoring (RUM)

Download a 16 KB static file from a CDN to a
browser > send timing data to our server

More details later on how we do RUM
Total load time (median) in US
Total load time (mean) in US
DNS time (median) in US




     ~25% of total
DNS time (mean) in US
Connect time (median) in US
First byte time (median) in US
First byte time (mean) in US
Transfer time (median) in US
initcwnd of CDNs




http://www.cdnplanet.com/blog/initcwnd-settings-major-cdn-providers/
Weekdays vs Weekends (mean)

                  ogra phic:
        ren t dem          rough
  Diffe        conne ct th
    ep eople          kdays
Mor               wee
     prox ies on
What happened on June 19?
DNS time         First byte time

Improvement      Improvement for
for all CDNs     only 2 CDNs

Better caching   Object is more
at ISPs          popular > gets
                 served from
                 memory now, or ...
Australia: different playing field
CloudFront opened a POP in Sydney




                          lways wins
            Local POP a
Global performance




Is your CDN fast in your key countries?




 http://c.turbobytes.com/static/uploads/velocity12/world-static.html
 http://c.turbobytes.com/static/uploads/velocity12/world-anim.html
Performance varies between states




How fast is your CDN in your key states?




 http://c.turbobytes.com/static/uploads/velocity12/us-state-static.html
 http://c.turbobytes.com/static/uploads/velocity12/us-state-anim.html
Green: not so good in California
Much better in New York
15 kb versus 100 kb file




Measure performance of content you have
Monitoring CDN Performance




http://www.flickr.com/photos/59632563@N04/6261230701/
Access log files of origin

No data on how fast the CDN is (duh)

Two reasons to analyze 'em:

1. Cache MISS rate

2. Spot patterns in requests from the CDN
Access log files of CDN

Again, no data on how fast the CDN is

Three reasons to analyze 'em:

1. Cache MISS rate

2. Spot patterns in requests from the CDN

3. Spot HITs from far-away POPs
Hits from far-away POPs
'Backbone' synthetic monitoring

Datacenter-to-datacenter != the real world

Tells you nothing about real user experience



                 n't use i t
              Do
Real browser synthetic monitoring

Catchpoint, Gomez, WebPagetest etc.

Real browser, but

– Still in a datacenter

– Not your real users
                         no cigar
            C lose , but
With-CDN versus Without-CDN

How much faster do your pages load?

WebPagetest:

SetDNSName   cdn.domain.com   www.domain.com
overrideHost cdn.domain.com   www.domain.com
navigate     www.domain.com
Google Analytics User Timings
var startTime;
function loadJs(url, callback) {
     var js = document.createElement('script');
     js.async = js.src = url;
     var s = document.getElementsByTagName('script')[0];



                                      less
     js.onload = callback;


                                  Use
     startTime = new Date().getTime();
     s.parentNode.insertBefore(js, s);
}
function myCallback() {
     var endTime = new Date().getTime();

  _gaq.push(['_trackTiming', 'jQuery', 'Load Library', new Date().getTime() -
startTime, 'Google CDN', 50]);
};
loadJs('//hostname/path/to/jquery.min.js', myCallback);

    https://developers.google.com/analytics/devguides/collection/gajs/gaTrackingTiming
Resource Timing API
'Navigation Timing for page resources'

Cross-origin resources must be sent with
Timing-Allow-Origin:example.com header for
API to expose load time details (DNS, etc.)
Easy: send header from origin, so CDN sends it too


                          Future!
http://dvcs.w3.org/hg/webperf/raw-file/tip/specs/ResourceTiming/Overview.html
How we do RUM




http://www.flickr.com/photos/like_the_grand_canyon/4580931101/
Starting points

Measure small object delivery over HTTP

We want the details, not just total load time

Few beacons from many users, not many
beacons from few users

No impact on UX
Why use a 16 KB file?
What we actually do
Navigation Timing API
loadTime = responseEnd – domainLookupStart

2 lines JS on main page; exec after window.onload
Load rum.js async (not in IE6-8)
Check localStorage which CDNs may be used
Load 16 kb HTML file from CDN, in invisible iframe
postMessage timing data from iframe to parent
Don't wait longer than 5 seconds
Update localStorage & beacon to server
Not all data is good data
NT API implementation is poor in some browsers
Ignore FF<9 & Chrome Frame
We see odd data in Chrome and IE9 too


Server side checks include:
  Is DNS time >0?
  Is Connect time > 0?
  Is TTFB >0?
Tips for improving CDN performance




http://www.flickr.com/photos/ol1/5539623423/
1




                         Set a high initcwnd

        íf the CDN has a large receive window



http://www.flickr.com/photos/59632563@N04/6261230701/
initrwnd of CDNs
2




       Keep connection to CDN open loooong

   only íf the CDN wants to keep it open long



http://www.flickr.com/photos/59632563@N04/6261230701/
3




                send Vary:Accept-Encoding

 … so your CDN sends GZIPed when it should



http://www.flickr.com/photos/59632563@N04/6261230701/
4




                 don't send Vary:User-Agent

           … to prevent a high cache MISS rate

http://www.flickr.com/photos/begnaud/243996426/
5




           add jitter to low TTL cache-control

           for better UX and origin protection



http://www.flickr.com/photos/59632563@N04/6261230701/
6




                          set high TTL for DNS

    especially important if traffic is low/med



http://www.flickr.com/photos/59632563@N04/6261230701/
http://www.flickr.com/photos/27282406@N03/4134166721/
www.turbobytes.com

More Related Content

What's hot

Optimising Web Application Frontend
Optimising Web Application FrontendOptimising Web Application Frontend
Optimising Web Application Frontend
tkramar
 
Caching the Uncacheable: Leveraging Your CDN to Cache Dynamic Content
Caching the Uncacheable: Leveraging Your CDN to Cache Dynamic ContentCaching the Uncacheable: Leveraging Your CDN to Cache Dynamic Content
Caching the Uncacheable: Leveraging Your CDN to Cache Dynamic Content
Fastly
 
Choosing a Web Architecture for Perl
Choosing a Web Architecture for PerlChoosing a Web Architecture for Perl
Choosing a Web Architecture for Perl
Perrin Harkins
 
Nginx: Accelerate Rails, HTTP Tricks
Nginx: Accelerate Rails, HTTP TricksNginx: Accelerate Rails, HTTP Tricks
Nginx: Accelerate Rails, HTTP Tricks
Adam Wiggins
 
ITB2017 - Nginx Effective High Availability Content Caching
ITB2017 - Nginx Effective High Availability Content CachingITB2017 - Nginx Effective High Availability Content Caching
ITB2017 - Nginx Effective High Availability Content Caching
Ortus Solutions, Corp
 
Load Balancing with Nginx
Load Balancing with NginxLoad Balancing with Nginx
Load Balancing with Nginx
Marian Marinov
 
HTTP Acceleration with Varnish
HTTP Acceleration with VarnishHTTP Acceleration with Varnish
HTTP Acceleration with Varnish
Harlow Ward
 
Content Caching with NGINX and NGINX Plus
Content Caching with NGINX and NGINX PlusContent Caching with NGINX and NGINX Plus
Content Caching with NGINX and NGINX Plus
Kevin Jones
 
Mobile & Desktop Cache 2.0: How To Create A Scriptable Cache
Mobile & Desktop Cache 2.0: How To Create A Scriptable CacheMobile & Desktop Cache 2.0: How To Create A Scriptable Cache
Mobile & Desktop Cache 2.0: How To Create A Scriptable Cache
Blaze Software Inc.
 
SPA2015: Hooman Beheshti – The Future of CDNs
SPA2015: Hooman Beheshti – The Future of CDNsSPA2015: Hooman Beheshti – The Future of CDNs
SPA2015: Hooman Beheshti – The Future of CDNs
Fastly
 
Scalable talk notes
Scalable talk notesScalable talk notes
Scalable talk notes
Perrin Harkins
 
Django and Nginx reverse proxy cache
Django and Nginx reverse proxy cacheDjango and Nginx reverse proxy cache
Django and Nginx reverse proxy cache
Anton Pirker
 
Web performance mercadolibre - ECI 2013
Web performance   mercadolibre - ECI 2013Web performance   mercadolibre - ECI 2013
Web performance mercadolibre - ECI 2013
Santiago Aimetta
 
Server architecture
Server architectureServer architecture
Server architecture
Masters Academy
 
NGINX Plus on AWS
NGINX Plus on AWSNGINX Plus on AWS
NGINX Plus on AWS
Amazon Web Services
 
Delivering High-Availability Web Services with NGINX Plus on AWS
Delivering High-Availability Web Services with NGINX Plus on AWSDelivering High-Availability Web Services with NGINX Plus on AWS
Delivering High-Availability Web Services with NGINX Plus on AWS
NGINX, Inc.
 
Caching the Uncacheable [Long Version]
Caching the Uncacheable [Long Version]Caching the Uncacheable [Long Version]
Caching the Uncacheable [Long Version]
Fastly
 
Stress Test Drupal on Amazon EC2 vs. RackSpace cloud
Stress Test Drupal on Amazon EC2 vs. RackSpace cloudStress Test Drupal on Amazon EC2 vs. RackSpace cloud
Stress Test Drupal on Amazon EC2 vs. RackSpace cloud
Andy Kucharski
 
Frontend performance
Frontend performanceFrontend performance
Frontend performance
sacred 8
 
(NET308) Consolidating DNS Data in the Cloud with Amazon Route 53
(NET308) Consolidating DNS Data in the Cloud with Amazon Route 53(NET308) Consolidating DNS Data in the Cloud with Amazon Route 53
(NET308) Consolidating DNS Data in the Cloud with Amazon Route 53
Amazon Web Services
 

What's hot (20)

Optimising Web Application Frontend
Optimising Web Application FrontendOptimising Web Application Frontend
Optimising Web Application Frontend
 
Caching the Uncacheable: Leveraging Your CDN to Cache Dynamic Content
Caching the Uncacheable: Leveraging Your CDN to Cache Dynamic ContentCaching the Uncacheable: Leveraging Your CDN to Cache Dynamic Content
Caching the Uncacheable: Leveraging Your CDN to Cache Dynamic Content
 
Choosing a Web Architecture for Perl
Choosing a Web Architecture for PerlChoosing a Web Architecture for Perl
Choosing a Web Architecture for Perl
 
Nginx: Accelerate Rails, HTTP Tricks
Nginx: Accelerate Rails, HTTP TricksNginx: Accelerate Rails, HTTP Tricks
Nginx: Accelerate Rails, HTTP Tricks
 
ITB2017 - Nginx Effective High Availability Content Caching
ITB2017 - Nginx Effective High Availability Content CachingITB2017 - Nginx Effective High Availability Content Caching
ITB2017 - Nginx Effective High Availability Content Caching
 
Load Balancing with Nginx
Load Balancing with NginxLoad Balancing with Nginx
Load Balancing with Nginx
 
HTTP Acceleration with Varnish
HTTP Acceleration with VarnishHTTP Acceleration with Varnish
HTTP Acceleration with Varnish
 
Content Caching with NGINX and NGINX Plus
Content Caching with NGINX and NGINX PlusContent Caching with NGINX and NGINX Plus
Content Caching with NGINX and NGINX Plus
 
Mobile & Desktop Cache 2.0: How To Create A Scriptable Cache
Mobile & Desktop Cache 2.0: How To Create A Scriptable CacheMobile & Desktop Cache 2.0: How To Create A Scriptable Cache
Mobile & Desktop Cache 2.0: How To Create A Scriptable Cache
 
SPA2015: Hooman Beheshti – The Future of CDNs
SPA2015: Hooman Beheshti – The Future of CDNsSPA2015: Hooman Beheshti – The Future of CDNs
SPA2015: Hooman Beheshti – The Future of CDNs
 
Scalable talk notes
Scalable talk notesScalable talk notes
Scalable talk notes
 
Django and Nginx reverse proxy cache
Django and Nginx reverse proxy cacheDjango and Nginx reverse proxy cache
Django and Nginx reverse proxy cache
 
Web performance mercadolibre - ECI 2013
Web performance   mercadolibre - ECI 2013Web performance   mercadolibre - ECI 2013
Web performance mercadolibre - ECI 2013
 
Server architecture
Server architectureServer architecture
Server architecture
 
NGINX Plus on AWS
NGINX Plus on AWSNGINX Plus on AWS
NGINX Plus on AWS
 
Delivering High-Availability Web Services with NGINX Plus on AWS
Delivering High-Availability Web Services with NGINX Plus on AWSDelivering High-Availability Web Services with NGINX Plus on AWS
Delivering High-Availability Web Services with NGINX Plus on AWS
 
Caching the Uncacheable [Long Version]
Caching the Uncacheable [Long Version]Caching the Uncacheable [Long Version]
Caching the Uncacheable [Long Version]
 
Stress Test Drupal on Amazon EC2 vs. RackSpace cloud
Stress Test Drupal on Amazon EC2 vs. RackSpace cloudStress Test Drupal on Amazon EC2 vs. RackSpace cloud
Stress Test Drupal on Amazon EC2 vs. RackSpace cloud
 
Frontend performance
Frontend performanceFrontend performance
Frontend performance
 
(NET308) Consolidating DNS Data in the Cloud with Amazon Route 53
(NET308) Consolidating DNS Data in the Cloud with Amazon Route 53(NET308) Consolidating DNS Data in the Cloud with Amazon Route 53
(NET308) Consolidating DNS Data in the Cloud with Amazon Route 53
 

Similar to Getting a Grip on CDN Performance - Why and How

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 ...
Amazon Web Services
 
Make Drupal Run Fast - increase page load speed
Make Drupal Run Fast - increase page load speedMake Drupal Run Fast - increase page load speed
Make Drupal Run Fast - increase page load speed
Andy Kucharski
 
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)
Amazon Web Services
 
Make Drupal Run Fast - increase page load speed
Make Drupal Run Fast - increase page load speedMake Drupal Run Fast - increase page load speed
Make Drupal Run Fast - increase page load speed
Promet Source
 
Improve Page Render Time with Amazon Cloudfront
Improve Page Render Time with Amazon CloudfrontImprove Page Render Time with Amazon Cloudfront
Improve Page Render Time with Amazon Cloudfront
Polyvore
 
Optimizing website performance
Optimizing website performanceOptimizing website performance
Optimizing website performance
Publisto Ltd.
 
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) ...
Amazon Web Services
 
Speed Up WordPress Websites - Part 1 - WordPress Cairo Meetup
Speed Up WordPress Websites - Part 1 - WordPress Cairo MeetupSpeed Up WordPress Websites - Part 1 - WordPress Cairo Meetup
Speed Up WordPress Websites - Part 1 - WordPress Cairo Meetup
Ahmed Mohammed Nagdy
 
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?)
SOASTA
 
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?)
Cliff Crocker
 
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?)
Tammy Everts
 
Cdn
CdnCdn
AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...
AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...
AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...
Amazon Web Services
 
5 steps to faster web sites & HTML5 games - updated for DDDscot
5 steps to faster web sites & HTML5 games - updated for DDDscot5 steps to faster web sites & HTML5 games - updated for DDDscot
5 steps to faster web sites & HTML5 games - updated for DDDscot
Michael Ewins
 
Drupal performance optimization Best Practices
Drupal performance optimization Best PracticesDrupal performance optimization Best Practices
Drupal performance optimization Best Practices
Ratnesh kumar, CSM
 
Cloud CDN User Manual Guide
Cloud CDN User Manual GuideCloud CDN User Manual Guide
Cloud CDN User Manual Guide
CloudOYE - Cloud Hosting Provider
 
When dispatcher caching is not enough... (extended version)
When dispatcher caching is not enough... (extended version)When dispatcher caching is not enough... (extended version)
When dispatcher caching is not enough... (extended version)
Jakub Wadolowski
 
When dispatcher caching is not enough by Jakub Wądołowski
When dispatcher caching is not enough by Jakub WądołowskiWhen dispatcher caching is not enough by Jakub Wądołowski
When dispatcher caching is not enough by Jakub Wądołowski
AEM HUB
 
Reducing latency on the web with the Azure CDN - DevSum - SWAG
Reducing latency on the web with the Azure CDN - DevSum - SWAGReducing latency on the web with the Azure CDN - DevSum - SWAG
Reducing latency on the web with the Azure CDN - DevSum - SWAG
Maarten Balliauw
 
AJAX for Scalability
AJAX for ScalabilityAJAX for Scalability
AJAX for Scalability
Tuenti
 

Similar to Getting a Grip on CDN Performance - Why and How (20)

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 ...
 
Make Drupal Run Fast - increase page load speed
Make Drupal Run Fast - increase page load speedMake Drupal Run Fast - increase page load speed
Make Drupal Run Fast - increase page load speed
 
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)
 
Make Drupal Run Fast - increase page load speed
Make Drupal Run Fast - increase page load speedMake Drupal Run Fast - increase page load speed
Make Drupal Run Fast - increase page load speed
 
Improve Page Render Time with Amazon Cloudfront
Improve Page Render Time with Amazon CloudfrontImprove Page Render Time with Amazon Cloudfront
Improve Page Render Time with Amazon Cloudfront
 
Optimizing website performance
Optimizing website performanceOptimizing website performance
Optimizing website performance
 
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) ...
 
Speed Up WordPress Websites - Part 1 - WordPress Cairo Meetup
Speed Up WordPress Websites - Part 1 - WordPress Cairo MeetupSpeed Up WordPress Websites - Part 1 - WordPress Cairo Meetup
Speed Up WordPress Websites - Part 1 - WordPress Cairo Meetup
 
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?)
 
Cdn
CdnCdn
Cdn
 
AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...
AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...
AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...
 
5 steps to faster web sites & HTML5 games - updated for DDDscot
5 steps to faster web sites & HTML5 games - updated for DDDscot5 steps to faster web sites & HTML5 games - updated for DDDscot
5 steps to faster web sites & HTML5 games - updated for DDDscot
 
Drupal performance optimization Best Practices
Drupal performance optimization Best PracticesDrupal performance optimization Best Practices
Drupal performance optimization Best Practices
 
Cloud CDN User Manual Guide
Cloud CDN User Manual GuideCloud CDN User Manual Guide
Cloud CDN User Manual Guide
 
When dispatcher caching is not enough... (extended version)
When dispatcher caching is not enough... (extended version)When dispatcher caching is not enough... (extended version)
When dispatcher caching is not enough... (extended version)
 
When dispatcher caching is not enough by Jakub Wądołowski
When dispatcher caching is not enough by Jakub WądołowskiWhen dispatcher caching is not enough by Jakub Wądołowski
When dispatcher caching is not enough by Jakub Wądołowski
 
Reducing latency on the web with the Azure CDN - DevSum - SWAG
Reducing latency on the web with the Azure CDN - DevSum - SWAGReducing latency on the web with the Azure CDN - DevSum - SWAG
Reducing latency on the web with the Azure CDN - DevSum - SWAG
 
AJAX for Scalability
AJAX for ScalabilityAJAX for Scalability
AJAX for Scalability
 

Recently uploaded

Distributed System Performance Troubleshooting Like You’ve Been Doing it for ...
Distributed System Performance Troubleshooting Like You’ve Been Doing it for ...Distributed System Performance Troubleshooting Like You’ve Been Doing it for ...
Distributed System Performance Troubleshooting Like You’ve Been Doing it for ...
ScyllaDB
 
AI_dev Europe 2024 - From OpenAI to Opensource AI
AI_dev Europe 2024 - From OpenAI to Opensource AIAI_dev Europe 2024 - From OpenAI to Opensource AI
AI_dev Europe 2024 - From OpenAI to Opensource AI
Raphaël Semeteys
 
Chapter 4 - Test Analysis & Design Techniques V4.0
Chapter 4 - Test Analysis & Design Techniques V4.0Chapter 4 - Test Analysis & Design Techniques V4.0
Chapter 4 - Test Analysis & Design Techniques V4.0
Neeraj Kumar Singh
 
Knowledge and Prompt Engineering Part 2 Focus on Prompt Design Approaches
Knowledge and Prompt Engineering Part 2 Focus on Prompt Design ApproachesKnowledge and Prompt Engineering Part 2 Focus on Prompt Design Approaches
Knowledge and Prompt Engineering Part 2 Focus on Prompt Design Approaches
Earley Information Science
 
Quality Patents: Patents That Stand the Test of Time
Quality Patents: Patents That Stand the Test of TimeQuality Patents: Patents That Stand the Test of Time
Quality Patents: Patents That Stand the Test of Time
Aurora Consulting
 
GDG Cloud Southlake #34: Neatsun Ziv: Automating Appsec
GDG Cloud Southlake #34: Neatsun Ziv: Automating AppsecGDG Cloud Southlake #34: Neatsun Ziv: Automating Appsec
GDG Cloud Southlake #34: Neatsun Ziv: Automating Appsec
James Anderson
 
Lessons Of Binary Analysis - Christien Rioux
Lessons Of Binary Analysis - Christien RiouxLessons Of Binary Analysis - Christien Rioux
Lessons Of Binary Analysis - Christien Rioux
crioux1
 
this resume for sadika shaikh bca student
this resume for sadika shaikh bca studentthis resume for sadika shaikh bca student
this resume for sadika shaikh bca student
SadikaShaikh7
 
Kubernetes Cloud Native Indonesia Meetup - June 2024
Kubernetes Cloud Native Indonesia Meetup - June 2024Kubernetes Cloud Native Indonesia Meetup - June 2024
Kubernetes Cloud Native Indonesia Meetup - June 2024
Prasta Maha
 
How to Improve Your Ability to Solve Complex Performance Problems
How to Improve Your Ability to Solve Complex Performance ProblemsHow to Improve Your Ability to Solve Complex Performance Problems
How to Improve Your Ability to Solve Complex Performance Problems
ScyllaDB
 
Transcript: Details of description part II: Describing images in practice - T...
Transcript: Details of description part II: Describing images in practice - T...Transcript: Details of description part II: Describing images in practice - T...
Transcript: Details of description part II: Describing images in practice - T...
BookNet Canada
 
Cookies program to display the information though cookie creation
Cookies program to display the information though cookie creationCookies program to display the information though cookie creation
Cookies program to display the information though cookie creation
shanthidl1
 
New ThousandEyes Product Features and Release Highlights: June 2024
New ThousandEyes Product Features and Release Highlights: June 2024New ThousandEyes Product Features and Release Highlights: June 2024
New ThousandEyes Product Features and Release Highlights: June 2024
ThousandEyes
 
Summer24-ReleaseOverviewDeck - Stephen Stanley 27 June 2024.pdf
Summer24-ReleaseOverviewDeck - Stephen Stanley 27 June 2024.pdfSummer24-ReleaseOverviewDeck - Stephen Stanley 27 June 2024.pdf
Summer24-ReleaseOverviewDeck - Stephen Stanley 27 June 2024.pdf
Anna Loughnan Colquhoun
 
HTTP Adaptive Streaming – Quo Vadis (2024)
HTTP Adaptive Streaming – Quo Vadis (2024)HTTP Adaptive Streaming – Quo Vadis (2024)
HTTP Adaptive Streaming – Quo Vadis (2024)
Alpen-Adria-Universität
 
Coordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar SlidesCoordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar Slides
Safe Software
 
UiPath Community Day Kraków: Devs4Devs Conference
UiPath Community Day Kraków: Devs4Devs ConferenceUiPath Community Day Kraków: Devs4Devs Conference
UiPath Community Day Kraków: Devs4Devs Conference
UiPathCommunity
 
Supercomputing from the Desktop Workstation
Supercomputingfrom the Desktop WorkstationSupercomputingfrom the Desktop Workstation
Supercomputing from the Desktop Workstation
Larry Smarr
 
Blockchain and Cyber Defense Strategies in new genre times
Blockchain and Cyber Defense Strategies in new genre timesBlockchain and Cyber Defense Strategies in new genre times
Blockchain and Cyber Defense Strategies in new genre times
anupriti
 
Getting Started Using the National Research Platform
Getting Started Using the National Research PlatformGetting Started Using the National Research Platform
Getting Started Using the National Research Platform
Larry Smarr
 

Recently uploaded (20)

Distributed System Performance Troubleshooting Like You’ve Been Doing it for ...
Distributed System Performance Troubleshooting Like You’ve Been Doing it for ...Distributed System Performance Troubleshooting Like You’ve Been Doing it for ...
Distributed System Performance Troubleshooting Like You’ve Been Doing it for ...
 
AI_dev Europe 2024 - From OpenAI to Opensource AI
AI_dev Europe 2024 - From OpenAI to Opensource AIAI_dev Europe 2024 - From OpenAI to Opensource AI
AI_dev Europe 2024 - From OpenAI to Opensource AI
 
Chapter 4 - Test Analysis & Design Techniques V4.0
Chapter 4 - Test Analysis & Design Techniques V4.0Chapter 4 - Test Analysis & Design Techniques V4.0
Chapter 4 - Test Analysis & Design Techniques V4.0
 
Knowledge and Prompt Engineering Part 2 Focus on Prompt Design Approaches
Knowledge and Prompt Engineering Part 2 Focus on Prompt Design ApproachesKnowledge and Prompt Engineering Part 2 Focus on Prompt Design Approaches
Knowledge and Prompt Engineering Part 2 Focus on Prompt Design Approaches
 
Quality Patents: Patents That Stand the Test of Time
Quality Patents: Patents That Stand the Test of TimeQuality Patents: Patents That Stand the Test of Time
Quality Patents: Patents That Stand the Test of Time
 
GDG Cloud Southlake #34: Neatsun Ziv: Automating Appsec
GDG Cloud Southlake #34: Neatsun Ziv: Automating AppsecGDG Cloud Southlake #34: Neatsun Ziv: Automating Appsec
GDG Cloud Southlake #34: Neatsun Ziv: Automating Appsec
 
Lessons Of Binary Analysis - Christien Rioux
Lessons Of Binary Analysis - Christien RiouxLessons Of Binary Analysis - Christien Rioux
Lessons Of Binary Analysis - Christien Rioux
 
this resume for sadika shaikh bca student
this resume for sadika shaikh bca studentthis resume for sadika shaikh bca student
this resume for sadika shaikh bca student
 
Kubernetes Cloud Native Indonesia Meetup - June 2024
Kubernetes Cloud Native Indonesia Meetup - June 2024Kubernetes Cloud Native Indonesia Meetup - June 2024
Kubernetes Cloud Native Indonesia Meetup - June 2024
 
How to Improve Your Ability to Solve Complex Performance Problems
How to Improve Your Ability to Solve Complex Performance ProblemsHow to Improve Your Ability to Solve Complex Performance Problems
How to Improve Your Ability to Solve Complex Performance Problems
 
Transcript: Details of description part II: Describing images in practice - T...
Transcript: Details of description part II: Describing images in practice - T...Transcript: Details of description part II: Describing images in practice - T...
Transcript: Details of description part II: Describing images in practice - T...
 
Cookies program to display the information though cookie creation
Cookies program to display the information though cookie creationCookies program to display the information though cookie creation
Cookies program to display the information though cookie creation
 
New ThousandEyes Product Features and Release Highlights: June 2024
New ThousandEyes Product Features and Release Highlights: June 2024New ThousandEyes Product Features and Release Highlights: June 2024
New ThousandEyes Product Features and Release Highlights: June 2024
 
Summer24-ReleaseOverviewDeck - Stephen Stanley 27 June 2024.pdf
Summer24-ReleaseOverviewDeck - Stephen Stanley 27 June 2024.pdfSummer24-ReleaseOverviewDeck - Stephen Stanley 27 June 2024.pdf
Summer24-ReleaseOverviewDeck - Stephen Stanley 27 June 2024.pdf
 
HTTP Adaptive Streaming – Quo Vadis (2024)
HTTP Adaptive Streaming – Quo Vadis (2024)HTTP Adaptive Streaming – Quo Vadis (2024)
HTTP Adaptive Streaming – Quo Vadis (2024)
 
Coordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar SlidesCoordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar Slides
 
UiPath Community Day Kraków: Devs4Devs Conference
UiPath Community Day Kraków: Devs4Devs ConferenceUiPath Community Day Kraków: Devs4Devs Conference
UiPath Community Day Kraków: Devs4Devs Conference
 
Supercomputing from the Desktop Workstation
Supercomputingfrom the Desktop WorkstationSupercomputingfrom the Desktop Workstation
Supercomputing from the Desktop Workstation
 
Blockchain and Cyber Defense Strategies in new genre times
Blockchain and Cyber Defense Strategies in new genre timesBlockchain and Cyber Defense Strategies in new genre times
Blockchain and Cyber Defense Strategies in new genre times
 
Getting Started Using the National Research Platform
Getting Started Using the National Research PlatformGetting Started Using the National Research Platform
Getting Started Using the National Research Platform
 

Getting a Grip on CDN Performance - Why and How

  • 1. Getting a Grip on CDN Performance Why & How http://www.flickr.com/photos/59632563@N04/6261230701/
  • 2. How many sites use a CDN?
  • 3. CDN Performance in the Real World http://www.flickr.com/photos/59632563@N04/6261230701/
  • 4. How we measure CDN performance Real User Monitoring (RUM) Download a 16 KB static file from a CDN to a browser > send timing data to our server More details later on how we do RUM
  • 5. Total load time (median) in US
  • 6. Total load time (mean) in US
  • 7. DNS time (median) in US ~25% of total
  • 10. First byte time (median) in US
  • 11. First byte time (mean) in US
  • 14. Weekdays vs Weekends (mean) ogra phic: ren t dem rough Diffe conne ct th ep eople kdays Mor wee prox ies on
  • 15. What happened on June 19? DNS time First byte time Improvement Improvement for for all CDNs only 2 CDNs Better caching Object is more at ISPs popular > gets served from memory now, or ...
  • 17. CloudFront opened a POP in Sydney lways wins Local POP a
  • 18. Global performance Is your CDN fast in your key countries? http://c.turbobytes.com/static/uploads/velocity12/world-static.html http://c.turbobytes.com/static/uploads/velocity12/world-anim.html
  • 19. Performance varies between states How fast is your CDN in your key states? http://c.turbobytes.com/static/uploads/velocity12/us-state-static.html http://c.turbobytes.com/static/uploads/velocity12/us-state-anim.html
  • 20. Green: not so good in California
  • 21. Much better in New York
  • 22. 15 kb versus 100 kb file Measure performance of content you have
  • 24. Access log files of origin No data on how fast the CDN is (duh) Two reasons to analyze 'em: 1. Cache MISS rate 2. Spot patterns in requests from the CDN
  • 25. Access log files of CDN Again, no data on how fast the CDN is Three reasons to analyze 'em: 1. Cache MISS rate 2. Spot patterns in requests from the CDN 3. Spot HITs from far-away POPs
  • 27. 'Backbone' synthetic monitoring Datacenter-to-datacenter != the real world Tells you nothing about real user experience n't use i t Do
  • 28. Real browser synthetic monitoring Catchpoint, Gomez, WebPagetest etc. Real browser, but – Still in a datacenter – Not your real users no cigar C lose , but
  • 29. With-CDN versus Without-CDN How much faster do your pages load? WebPagetest: SetDNSName cdn.domain.com www.domain.com overrideHost cdn.domain.com www.domain.com navigate www.domain.com
  • 30. Google Analytics User Timings var startTime; function loadJs(url, callback) { var js = document.createElement('script'); js.async = js.src = url; var s = document.getElementsByTagName('script')[0]; less js.onload = callback; Use startTime = new Date().getTime(); s.parentNode.insertBefore(js, s); } function myCallback() { var endTime = new Date().getTime(); _gaq.push(['_trackTiming', 'jQuery', 'Load Library', new Date().getTime() - startTime, 'Google CDN', 50]); }; loadJs('//hostname/path/to/jquery.min.js', myCallback); https://developers.google.com/analytics/devguides/collection/gajs/gaTrackingTiming
  • 31. Resource Timing API 'Navigation Timing for page resources' Cross-origin resources must be sent with Timing-Allow-Origin:example.com header for API to expose load time details (DNS, etc.) Easy: send header from origin, so CDN sends it too Future! http://dvcs.w3.org/hg/webperf/raw-file/tip/specs/ResourceTiming/Overview.html
  • 32. How we do RUM http://www.flickr.com/photos/like_the_grand_canyon/4580931101/
  • 33. Starting points Measure small object delivery over HTTP We want the details, not just total load time Few beacons from many users, not many beacons from few users No impact on UX
  • 34. Why use a 16 KB file?
  • 35. What we actually do Navigation Timing API loadTime = responseEnd – domainLookupStart 2 lines JS on main page; exec after window.onload Load rum.js async (not in IE6-8) Check localStorage which CDNs may be used Load 16 kb HTML file from CDN, in invisible iframe postMessage timing data from iframe to parent Don't wait longer than 5 seconds Update localStorage & beacon to server
  • 36. Not all data is good data NT API implementation is poor in some browsers Ignore FF<9 & Chrome Frame We see odd data in Chrome and IE9 too Server side checks include: Is DNS time >0? Is Connect time > 0? Is TTFB >0?
  • 37. Tips for improving CDN performance http://www.flickr.com/photos/ol1/5539623423/
  • 38. 1 Set a high initcwnd íf the CDN has a large receive window http://www.flickr.com/photos/59632563@N04/6261230701/
  • 40. 2 Keep connection to CDN open loooong only íf the CDN wants to keep it open long http://www.flickr.com/photos/59632563@N04/6261230701/
  • 41. 3 send Vary:Accept-Encoding … so your CDN sends GZIPed when it should http://www.flickr.com/photos/59632563@N04/6261230701/
  • 42. 4 don't send Vary:User-Agent … to prevent a high cache MISS rate http://www.flickr.com/photos/begnaud/243996426/
  • 43. 5 add jitter to low TTL cache-control for better UX and origin protection http://www.flickr.com/photos/59632563@N04/6261230701/
  • 44. 6 set high TTL for DNS especially important if traffic is low/med http://www.flickr.com/photos/59632563@N04/6261230701/