What	
  we	
  can	
  learn	
  from	
  CDNs	
  
about	
  Web	
  Development,	
  
Deployment,	
  and	
  Performance	
  
Hoom...
Who	
  am	
  I?	
  
•  Early	
  Load	
  Balancing	
  Vendors	
  
– Radware	
  
– Crescendo	
  Networks	
  
•  Front	
  End...
So,	
  really…	
  
What	
  I’ve	
  Learned	
  From	
  
Working	
  at	
  a	
  CDN	
  Company	
  
for	
  6	
  Weeks!!	
  
Lesson:	
  
	
  
CDNs	
  Are	
  Not	
  Solved!	
  
We	
  Don’t	
  Cache	
  As	
  Much	
  As	
  We	
  
Should!	
  
•  HTML	
  and	
  other	
  dynamic	
  content	
  
•  Worse	...
Making	
  Changes	
  SUCKS!!	
  
•  Configura+on	
  changes	
  take	
  way	
  too	
  long	
  
– People	
  are	
  used	
  to...
Lots	
  of	
  Room	
  
•  New	
  Demands	
  from	
  Customers	
  
•  Plenty	
  of	
  room	
  for	
  differen+a+on	
  
•  Ca...
Lesson:	
  
	
  
There’s	
  More	
  to	
  the	
  Web	
  Than	
  
the	
  Web!	
  
Non	
  “web”	
  Traffic	
  
•  Video	
  
–  HLS	
  (HTTP	
  Live	
  Streaming)	
  
–  HTTP-­‐based	
  small	
  video	
  chun...
Lesson:	
  
	
  
People	
  Use	
  Their	
  CDNs	
  Wrong	
  
CDNs	
  offer	
  a	
  toolset	
  
•  The	
  black	
  box	
  approach	
  isn’t	
  always	
  good	
  
•  Configura+on	
  isn’t...
hbp://bigqueri.es/t/sites-­‐that-­‐deliver-­‐images-­‐using-­‐gzip-­‐deflate-­‐encoding/220	
  
Gzipping	
  Images	
  
•  Not	
  a	
  very	
  good	
  thing	
  for	
  performance	
  
– Extra	
  bytes	
  
– Extra	
  work...
More	
  Examples	
  
•  Bad	
  caching	
  headers	
  
– max-­‐age,	
  s-­‐maxage	
  have	
  a	
  lot	
  of	
  power!	
  
•...
With	
  Great	
  Power…	
  
Lesson:	
  
	
  
Dynamic	
  Content	
  Is	
  Really	
  
InteresVng!	
  
What	
  Is	
  Dynamic	
  Content?	
  
•  Stuff	
  that’s	
  not	
  sta+c!	
  
•  With	
  web	
  traffic,	
  generally	
  the	...
Blocking	
  
Classically,	
  with	
  dynamic	
  content…	
  
Caching	
  
Caching	
  	
  
vs.	
  	
  
InvalidaVon	
  
We	
  tried…	
  
Dynamic	
  Content	
  Caching	
  Problems	
  
•  Serving	
  stale	
  pages	
  
– Lack	
  of	
  good	
  invalida+on	
  fram...
CDNs	
  and	
  Dynamic	
  Content	
  
•  Generally,	
  handling	
  dynamic	
  content	
  has	
  been	
  
a	
  maber	
  of	...
Actually…	
  
•  Dynamic	
  content	
  is	
  more	
  cacheable	
  than	
  we	
  
think	
  
•  Sta+c	
  for	
  short	
  per...
So	
  Many	
  Benefits!	
  
•  Performance	
  
– Faster	
  +me	
  to	
  first	
  byte	
  
– Faster	
  start	
  render	
  
– ...
What	
  Would	
  Make	
  It	
  BeZer?	
  
•  Programma+c	
  Invalida+on	
  
– Granular	
  
– Instantaneous	
  
•  Control	...
Lesson:	
  
	
  
IntegraVng	
  is	
  Awesome!	
  
The	
  Influence	
  of	
  Clouds	
  
•  DevOps	
  people	
  like	
  programmability	
  and	
  
integra+on	
  
•  The	
  CDN...
Real	
  Time	
  IntegraVon	
  
•  Tap	
  in	
  to	
  the	
  CDN:	
  
– Instantaneous	
  configura+on	
  changes	
  
– Insta...
About	
  Time!!	
  
Lesson:	
  
	
  
Measurement	
  is	
  SVll	
  Hard	
  
“SVll”	
  
•  In	
  the	
  world	
  of	
  FEO	
  
– Webpagetest.org	
  
– RUM	
  
– Synthe+c	
  tes+ng	
  vendors	
  
•  I...
Client-­‐side	
  Measurement	
  in	
  CDNs	
  
•  Cache	
  hit	
  ra+o	
  
– How	
  do	
  you	
  test	
  and	
  measure?	
...
Let’s	
  Test	
  It!	
  
•  3	
  Objects	
  on	
  the	
  same	
  CDN	
  (anonymous)	
  
–  Cedexis	
  object	
  
–  Small	...
Cedexis	
  Object	
  
Connect	
  (median)	
   Wait	
  (median)	
  
Cedexis	
   14ms	
   19ms	
  
Cedexis	
  Object	
   Alexa	
  5000	
  
Connect	
  (median)	
   Wait	
  (median)	
  
Cedexis	
   14ms	
   19ms	
  
Alexa	
...
Cedexis	
  Object	
   Alexa	
  5000	
  
Connect	
  (median)	
   Wait	
  (median)	
  
Cedexis	
   14ms	
   19ms	
  
Alexa	
...
Cedexis	
  Object	
   Long	
  Tail	
  Alexa	
  5000	
  
Connect	
  (median)	
   Wait	
  (median)	
  
Cedexis	
   14ms	
   ...
Cedexis	
  Object	
   Long	
  Tail	
  Alexa	
  5000	
  
Connect	
  (median)	
   Wait	
  (median)	
  
Cedexis	
   14ms	
   ...
Cedexis	
  Object	
  
Count	
   TCP	
   TTFB	
   Count	
   TCP	
   TTFB	
   Count	
   TCP	
   TTFB	
  
Mem	
   11,074	
   ...
Cedexis	
  Object	
   Alexa	
  5000	
  
Count	
   TCP	
   TTFB	
   Count	
   TCP	
   TTFB	
   Count	
   TCP	
   TTFB	
  
M...
Cedexis	
  Object	
   Long	
  Tail	
  Alexa	
  5000	
  
Count	
   TCP	
   TTFB	
   Count	
   TCP	
   TTFB	
   Count	
   TC...
Cedexis	
  Object	
   Long	
  Tail	
  Alexa	
  5000	
  
Count	
   TCP	
   TTFB	
   Count	
   TCP	
   TTFB	
   Count	
   TC...
Cedexis	
  Object	
   Long	
  Tail	
  Alexa	
  5000	
  
Count	
   TCP	
   TTFB	
   Count	
   TCP	
   TTFB	
   Count	
   TC...
Cedexis	
  Object	
   Long	
  Tail	
  Alexa	
  5000	
  
Count	
   TCP	
   TTFB	
   Count	
   TCP	
   TTFB	
   Count	
   TC...
Measurement!	
  
•  Not	
  only	
  do	
  I	
  care	
  about:	
  
– Cache	
  hit	
  rate	
  
– Long	
  tail	
  
– Measuring...
Lesson:	
  
	
  
It’s	
  Not	
  Only	
  About…	
  
…Performance!!!	
  
Security	
  
•  Cer+ficate	
  management	
  
•  Perimeter	
  security	
  
•  DDoS	
  protec+on	
  <-­‐	
  benefit	
  of	
  s...
Flexibility,	
  Visibility,	
  and	
  Control	
  
•  Integra+on	
  
•  Programmability	
  
•  APIs	
  
•  Instant	
  purgi...
Fun	
  at	
  the	
  Edge!	
  
•  Synthe+c	
  responses	
  
–  Example:	
  node	
  ID	
  for	
  Cedexis	
  measurements	
  ...
PERFORMANCE!!	
  
It’s	
  s+ll	
  preby	
  damn	
  important!	
  
Thank	
  you!	
  
hooman@fastly.com	
  
What we can learn from CDNs about Web Development, Deployment, and Performance
What we can learn from CDNs about Web Development, Deployment, and Performance
What we can learn from CDNs about Web Development, Deployment, and Performance
What we can learn from CDNs about Web Development, Deployment, and Performance
What we can learn from CDNs about Web Development, Deployment, and Performance
What we can learn from CDNs about Web Development, Deployment, and Performance
Upcoming SlideShare
Loading in …5
×

What we can learn from CDNs about Web Development, Deployment, and Performance

2,636 views

Published on

CDNs have become a core part of internet infrastructure, and application owners are building them into development and product roadmaps for improved efficiency, transparency and performance.

In his talk, Hooman shares recent learnings about the world of CDNs, how they're changing, and how Devs, Ops, and DevOps can integrate with them for optimal deployment and performance.

Hooman Beheshti is VP of Technology at Fastly, where he develops web performance services for the world's smartest CDN platform. A pioneer in the application acceleration space, Hooman helped design one of the original load balancers while at Radware and has held senior technology positions with Strangeloop Networks and Crescendo Networks. He has worked on the core technologies that make the Internet work faster for nearly 20 years and is an expert and frequent speaker on the subjects of load balancing, application performance, and content delivery networks.

Published in: Technology
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
2,636
On SlideShare
0
From Embeds
0
Number of Embeds
296
Actions
Shares
0
Downloads
14
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

What we can learn from CDNs about Web Development, Deployment, and Performance

  1. 1. What  we  can  learn  from  CDNs   about  Web  Development,   Deployment,  and  Performance   Hooman  Behesh+,  VP  Technology         WebPerf  Meetup,  NYC,  May  13,  2014  
  2. 2. Who  am  I?   •  Early  Load  Balancing  Vendors   – Radware   – Crescendo  Networks   •  Front  End  Op+miza+on   – Strangeloop  Networks   •  Off  the  grid  for  a  year!   •  Joined  Fastly  6  weeks  ago  
  3. 3. So,  really…  
  4. 4. What  I’ve  Learned  From   Working  at  a  CDN  Company   for  6  Weeks!!  
  5. 5. Lesson:     CDNs  Are  Not  Solved!  
  6. 6. We  Don’t  Cache  As  Much  As  We   Should!   •  HTML  and  other  dynamic  content   •  Worse  cache  hit  rate  than  we  think   – Especially  for  long  tail  content   •  Mobile  Apps,  APIs,  etc  
  7. 7. Making  Changes  SUCKS!!   •  Configura+on  changes  take  way  too  long   – People  are  used  to  making  changes  real-­‐+me   – CDNs  aren’t  classically  good  at  this   – Phone??   •  Purging  is  a  real  problem   – Slow   – Difficult   – Not  granular  enough  
  8. 8. Lots  of  Room   •  New  Demands  from  Customers   •  Plenty  of  room  for  differen+a+on   •  Can’t  take  some  things  for  granted:   – DNS   – Rou+ng   – TCP   – SCALE!   •  Plus:  lots  of  room  to  be  crea+ve  at  the  edge!  
  9. 9. Lesson:     There’s  More  to  the  Web  Than   the  Web!  
  10. 10. Non  “web”  Traffic   •  Video   –  HLS  (HTTP  Live  Streaming)   –  HTTP-­‐based  small  video  chunks   –  Unique  by  URL   •  APIs   –  Instant  purging  can  let  API  calls  be  cacheable   –  Another  example  of  dynamic  content  cached  at  the   edge   •  Mobile  Apps  
  11. 11. Lesson:     People  Use  Their  CDNs  Wrong  
  12. 12. CDNs  offer  a  toolset   •  The  black  box  approach  isn’t  always  good   •  Configura+on  isn’t  trivial   – And  a  lot  s+ll  depends  on  configura+on   •  Can’t  depend  on  the  CDN  to  solve  all  your   problems   •  Don’t  exacerbate  your  problems!  
  13. 13. hbp://bigqueri.es/t/sites-­‐that-­‐deliver-­‐images-­‐using-­‐gzip-­‐deflate-­‐encoding/220  
  14. 14. Gzipping  Images   •  Not  a  very  good  thing  for  performance   – Extra  bytes   – Extra  work  for  the  browser   •  But  was  this  the  Surrogate’s  fault?  
  15. 15. More  Examples   •  Bad  caching  headers   – max-­‐age,  s-­‐maxage  have  a  lot  of  power!   •  Bad  TCP  connec+on  management  at  origin   •  Not  Gzipping  (actual,  compressible  content)   for  origin  fetches    
  16. 16. With  Great  Power…  
  17. 17. Lesson:     Dynamic  Content  Is  Really   InteresVng!  
  18. 18. What  Is  Dynamic  Content?   •  Stuff  that’s  not  sta+c!   •  With  web  traffic,  generally  the  base  HTML   –  Big  deal  because  it’s  blocking   –  And  some+mes  the  largest  object;  longer  download   •  Some  AJAX   •  More…  
  19. 19. Blocking  
  20. 20. Classically,  with  dynamic  content…   Caching  
  21. 21. Caching     vs.     InvalidaVon  
  22. 22. We  tried…  
  23. 23. Dynamic  Content  Caching  Problems   •  Serving  stale  pages   – Lack  of  good  invalida+on  framework   •  Visibility   •  Logging    
  24. 24. CDNs  and  Dynamic  Content   •  Generally,  handling  dynamic  content  has  been   a  maber  of  transport   – Middle  mile  op+miza+ons   – TCP  tweaks   •  Some  edge  micro  caching,  but  not  easy   •  ESI    
  25. 25. Actually…   •  Dynamic  content  is  more  cacheable  than  we   think   •  Sta+c  for  short  periods  of  +me   •  Unpredictable  invalida+on   – Standard  HTTP  caching  rules  aren’t  good  enough  
  26. 26. So  Many  Benefits!   •  Performance   – Faster  +me  to  first  byte   – Faster  start  render   – Happy  users!   •  Offload   – Less  work  for  our  servers   – Less  bandwidth  at  origin  
  27. 27. What  Would  Make  It  BeZer?   •  Programma+c  Invalida+on   – Granular   – Instantaneous   •  Control  at  the  edge,  and  not  just  for  web   pages   – Real-­‐+me  log  files   – Imagine  termina+ng  beacons  at  the  edge!    
  28. 28. Lesson:     IntegraVng  is  Awesome!  
  29. 29. The  Influence  of  Clouds   •  DevOps  people  like  programmability  and   integra+on   •  The  CDN  is  no  longer  a  black  box  mechanism,   necessarily   •  Cliché  Alert:  Content  as  a  Service!  
  30. 30. Real  Time  IntegraVon   •  Tap  in  to  the  CDN:   – Instantaneous  configura+on  changes   – Instantaneous  cache  purge  and  invalida+on   – Real  +me  stats  and  logs   •  Infrastructure  as  code   – Expect  extensive  APIs   – Apps  need  to  naturally  extend  to  the  CDN   – Your  content  =>  you  need  control  
  31. 31. About  Time!!  
  32. 32. Lesson:     Measurement  is  SVll  Hard  
  33. 33. “SVll”   •  In  the  world  of  FEO   – Webpagetest.org   – RUM   – Synthe+c  tes+ng  vendors   •  In  the  world  of  CDNs   – Same  as  far  as  client  performance  goes   – Some  new  things…  
  34. 34. Client-­‐side  Measurement  in  CDNs   •  Cache  hit  ra+o   – How  do  you  test  and  measure?   •  Long  tail  content?   •  DNS  and  edge  node  selec+on   •  TTFB  out  of  datacenter   – Memory  hit  vs  disk  hit  vs  mid-­‐+er  hit  vs  miss   •  RUM  and  synthe+c  (Cedexis,  Catchpoint,  etc)   •  There’s  s+ll  gaming  going  on!  
  35. 35. Let’s  Test  It!   •  3  Objects  on  the  same  CDN  (anonymous)   –  Cedexis  object   –  Small  image  from  Alexa  5000  site   –  Long  tail  object:  ~40  +mes  every  3-­‐4  hours   •  Use  Catchpoint  last  mile  clients  in  US   –  Test  every  15  minutes   –  ~11,500  total  tests  across  all  test  nodes   •  Focus  measurement  on:   –  Connect  +me  (TCP)   –  Wait  +me  (TTFB)  
  36. 36. Cedexis  Object   Connect  (median)   Wait  (median)   Cedexis   14ms   19ms  
  37. 37. Cedexis  Object   Alexa  5000   Connect  (median)   Wait  (median)   Cedexis   14ms   19ms   Alexa  5000   14ms   24ms  
  38. 38. Cedexis  Object   Alexa  5000   Connect  (median)   Wait  (median)   Cedexis   14ms   19ms   Alexa  5000   14ms   24ms   26%  
  39. 39. Cedexis  Object   Long  Tail  Alexa  5000   Connect  (median)   Wait  (median)   Cedexis   14ms   19ms   Alexa  5000   14ms   24ms   Long  Tail   15ms   29ms  
  40. 40. Cedexis  Object   Long  Tail  Alexa  5000   Connect  (median)   Wait  (median)   Cedexis   14ms   19ms   Alexa  5000   14ms   24ms   Long  Tail   15ms   29ms   20%  
  41. 41. Cedexis  Object   Count   TCP   TTFB   Count   TCP   TTFB   Count   TCP   TTFB   Mem   11,074   14ms   19ms   481   14ms   19ms   6741   14ms   20ms   Disk   428   12ms   24ms   9626   15ms   28ms   4692   14ms   31ms   Miss   1   6ms   38ms   1355   16ms   51ms   28   13ms   45ms  
  42. 42. Cedexis  Object   Alexa  5000   Count   TCP   TTFB   Count   TCP   TTFB   Count   TCP   TTFB   Mem   11,074   14ms   19ms   6741   14ms   20ms   481   14ms   19ms   Disk   428   12ms   24ms   4692   14ms   31ms   9626   15ms   28ms   Miss   1   6ms   38ms   28   13ms   45ms   1355   16ms   51ms  
  43. 43. Cedexis  Object   Long  Tail  Alexa  5000   Count   TCP   TTFB   Count   TCP   TTFB   Count   TCP   TTFB   Mem   11,074   14ms   19ms   6741   14ms   20ms   481   14ms   19ms   Disk   428   12ms   24ms   4692   14ms   31ms   9626   15ms   28ms   Miss   1   6ms   38ms   28   13ms   45ms   1355   16ms   51ms  
  44. 44. Cedexis  Object   Long  Tail  Alexa  5000   Count   TCP   TTFB   Count   TCP   TTFB   Count   TCP   TTFB   Mem   11,074   14ms   19ms   6741   14ms   20ms   481   14ms   19ms   Disk   428   12ms   24ms   4692   14ms   31ms   9626   15ms   28ms   Miss   1   6ms   38ms   28   13ms   45ms   1355   16ms   51ms   99.99%   Mem:  96.27%   Disk:  3.72%  
  45. 45. Cedexis  Object   Long  Tail  Alexa  5000   Count   TCP   TTFB   Count   TCP   TTFB   Count   TCP   TTFB   Mem   11,074   14ms   19ms   6741   14ms   20ms   481   14ms   19ms   Disk   428   12ms   24ms   4692   14ms   31ms   9626   15ms   28ms   Miss   1   6ms   38ms   28   13ms   45ms   1355   16ms   51ms   99.99%   Mem:  96.27%   Disk:  3.72%   99.76%   Mem:  58.82%   Disk:  40.94%  
  46. 46. Cedexis  Object   Long  Tail  Alexa  5000   Count   TCP   TTFB   Count   TCP   TTFB   Count   TCP   TTFB   Mem   11,074   14ms   19ms   6741   14ms   20ms   481   14ms   19ms   Disk   428   12ms   24ms   4692   14ms   31ms   9626   15ms   28ms   Miss   1   6ms   38ms   28   13ms   45ms   1355   16ms   51ms   99.99%   Mem:  96.27%   Disk:  3.72%   99.76%   88.17%   Mem:  58.82%   Disk:  40.94%   Mem:  4.19%   Disk:  83.98%  
  47. 47. Measurement!   •  Not  only  do  I  care  about:   – Cache  hit  rate   – Long  tail   – Measuring  the  right  thing   •  Fetching  from  disk  could  suck!   – SSDs!   •  Caching  ≠  Caching  
  48. 48. Lesson:     It’s  Not  Only  About…  
  49. 49. …Performance!!!  
  50. 50. Security   •  Cer+ficate  management   •  Perimeter  security   •  DDoS  protec+on  <-­‐  benefit  of  scale!  
  51. 51. Flexibility,  Visibility,  and  Control   •  Integra+on   •  Programmability   •  APIs   •  Instant  purging   •  Real  +me  logs  
  52. 52. Fun  at  the  Edge!   •  Synthe+c  responses   –  Example:  node  ID  for  Cedexis  measurements   •  Cookie  manipula+on   –  Remove/inject/replace/recall   •  Beacon  termina+on   –  204  responses   –  Real  +me  logs   –  Awesome!  
  53. 53. PERFORMANCE!!   It’s  s+ll  preby  damn  important!  
  54. 54. Thank  you!   hooman@fastly.com  

×