Upgrade to Pro — share decks privately, control downloads, hide ads and more …

SPA2015: Hooman Beheshti – The Future of CDNs

Fastly
June 30, 2015

SPA2015: Hooman Beheshti – The Future of CDNs

Fastly VP of Technology Hooman Beheshti gives a keynote on The Future of CDNs at Software Practice Advancement Conference 2015.

Fastly

June 30, 2015
Tweet

More Decks by Fastly

Other Decks in Technology

Transcript

  1. CDN • Globally  distributed  network  of  servers • Built  primarily

     with  caching  engines  (squid,  nginx,  varnish,  etc) • Footprints  vary
  2. Deployment • Originally  simple: • Serve  root  web  page  (HTML)

     direct  from  origin • Point  static  assets  on  the  page  to  a  domain  owned  by  the  CDN • Everything  controlled  through  DNS
  3. Three  types  of  content • Static • Infrequent  changes,  can

     cache  for  a  long  time • Cache-­‐control  headers  are  often  good  enough • Examples:  images,  javascript,  css,  etc • Dynamic • Can’t  cache  at  all  – must  go  to  origin • DSA  and  transport  optimization  is  key  for  performance • Examples:  logins,  credit  card  transactions,  Ajax,  etc • Event-­‐driven: • Static,  but  unpredictably • Cache-­‐control  headers  are  not  good  enough  on  their  own • Examples:  news  stories,  wiki  pages,  user  comments,  sports  scores,  etc
  4. Three  types  of  content • Static • Infrequent  changes,  can

     cache  for  a  long  time • Cache-­‐control  headers  are  often  good  enough • Examples:  images,  javascript,  css,  etc • Dynamic • Can’t  cache  at  all  – must  go  to  origin • DSA  and  transport  optimization  is  key  for  performance • Examples:  logins,  credit  card  transactions,  Ajax,  etc • Event-­‐driven: • Static,  but  unpredictably • Cache-­‐control  headers  are  not  good  enough  on  their  own • Examples:  news  stories,  wiki  pages,  user  comments,  sports  scores,  etc
  5. Three  types  of  content • Static • Infrequent  changes,  can

     cache  for  a  long  time • Cache-­‐control  headers  are  often  good  enough • Examples:  images,  javascript,  css,  etc • Dynamic • Can’t  cache  at  all  – must  go  to  origin • DSA  and  transport  optimization  is  key  for  performance • Examples:  logins,  credit  card  transactions,  Ajax,  etc • Event-­‐driven: • Static,  but  unpredictably • Cache-­‐control  headers  are  not  good  enough  on  their  own • Examples:  news  stories,  wiki  pages,  user  comments,  sports  scores,  etc
  6. CDN  problems • Services  were  black  boxes • Lots  of

     professional  services • Caching  efficiency  has  decreased • Not  a  lot  of  visibility • No  real-­‐time  feedback • No  real-­‐time  interfaces • APIs • Not  enough  real-­‐time  control • Removing  content  from  the  CDN • Configuration  changes
  7. Caching  event-­‐driven  content • Caching  predictably  static  content  is  relatively

     straight  forward • Headers • Configuration • Caching  unpredictably  static  content  is  really  difficult • We  don’t  know  lifetime  in  advance • Trigger-­‐based  invalidation
  8. Purging  content  from  a  CDN • Event-­‐driven  content  can  be

     cached  if  the  CDN  allows  instantaneous   programmatic  purging • Cache  normally • Purge  when  change  trigger  happens • Rinse  and  repeat! • Slow  purge  times  unacceptable  in  this  case • We  need  instant purging • Deterministic  and  predictable
  9. Popular Medium  Tail  (1hr) Long  tail    (6hr) Connect  (median)

    Popular 14msec 1hr  Tail 15msec 6hr Tail 16msec
  10. Popular Medium  Tail  (1hr) Long  tail    (6hr) Connect  (median)

    Popular 14msec 1hr  Tail 15msec 6hr Tail 16msec
  11. Popular Medium  Tail  (1hr) Long  tail    (6hr) Connect  (median)

    Popular 14msec 1hr  Tail 15msec 6hr Tail 16msec
  12. Popular Medium  Tail  (1hr) Long  tail    (6hr) Connect  (median)

    Popular 14msec 1hr  Tail 15msec 6hr Tail 16msec
  13. Popular Medium  Tail  (1hr) Long  tail    (6hr) Connect  (median)

    Wait (median) Popular 14msec 19msec 1hr  Tail 15msec 26msec 6hr Tail 16msec 32msec
  14. Popular Medium  Tail  (1hr) Long  tail    (6hr) Connect  (median)

    Wait (median) Popular 14msec 19msec 1hr  Tail 15msec 26msec 6hr Tail 16msec 32msec 6,400+  measurements 77,000+  measurements 38,000+  measurements
  15. Caching • Cache  more • Serve  more  from  the  edge

    • Control  caching  and  uncaching,  instantaneously  
  16. Programmability • Granular  invalidation  API • Configuration  API • Logic

     at  the  edge • All  configuration  interaction  must  be  instantaneous
  17. Control  at  the  edge • Moving  application  logic  to  the

     edge • Example:  VCL  (Varnish  Configuration  Language) • Script-­‐like  configuration  for  functionality  at  the  edge
  18. Control  at  the  edge • Moving  application  logic  to  the

     edge • Example:  VCL  (Varnish  Configuration  Language) • Script-­‐like  configuration  for  functionality  at  the  edge • Not  exclusive  to  varnish • Any  mechanism  offered  by  the  CDN  to  allow  logic  to  be  executed  at  the  edge   is  good
  19. Logic  at  the  edge • Generate  content  at  the  edge

    • HTTP  header  manipulation • Origin  selection • Caching  rules • Geo-­‐IP  rules • Forcing  SSL • Serving  stale  content   • Etc,  etc,  etc
  20. Real-­‐time  analytics • Statistics  API • Network  stats • HTTP

     stats  (status  codes,  etc) • Caching  stats  (hits,  misses,  errors,  etc) • Everything  has  to  be  real-­‐time • Historic  data  is  also  a  must
  21. Logging • Daily  or  hourly  logs  are  not  good  enough

    • Logs  in  real-­‐time • Log  streaming • To  any  logging  destination  endpoint • Syslog,  S3,  FTP,  etc.
  22. Visibility • We  need  to  see  what’s  going  on •

    Real-­‐time  stats • Stats  API • Real-­‐time  logs
  23. Then CDN  Node Origin Log  Analysis HTTP/1.1 200 OK Expires:

    Wed, 19 Apr 2000 11:43:00 GMT Cache-Control: no-cache, no-store Last-Modified: Wed, 21 Jan 2004 19:51:30 GMT Content-Type: image/gif Date: Fri, 20 Jun 2014 12:22:20 GMT Server: Apache Content-Length: 35 http://collector.site.com/beacon.img?a=1&b=2&c=3
  24. Then CDN  Node Origin Log  Analysis HTTP/1.1 200 OK Expires:

    Wed, 19 Apr 2000 11:43:00 GMT Cache-Control: no-cache, no-store Last-Modified: Wed, 21 Jan 2004 19:51:30 GMT Content-Type: image/gif Date: Fri, 20 Jun 2014 12:22:20 GMT Server: Apache Content-Length: 35 http://collector.site.com/beacon.img?a=1&b=2&c=3
  25. Then CDN  Node Origin Log  Analysis HTTP/1.1 200 OK Expires:

    Wed, 19 Apr 2000 11:43:00 GMT Cache-Control: no-cache, no-store Last-Modified: Wed, 21 Jan 2004 19:51:30 GMT Content-Type: image/gif Date: Fri, 20 Jun 2014 12:22:20 GMT Server: Apache Content-Length: 35 http://collector.site.com/beacon.img?a=1&b=2&c=3
  26. Now CDN  Node Origin HTTP/1.1 200 OK Expires: Wed, 19

    Apr 2000 11:43:00 GMT Cache-Control: no-cache, no-store Last-Modified: Wed, 21 Jan 2004 19:51:30 GMT Content-Type: image/gif Date: Fri, 20 Jun 2014 12:22:20 GMT Server: Apache Content-Length: 35 http://collector.site.com/beacon.img?a=1&b=2&c=3
  27. Now  (204) CDN  Node Origin HTTP/1.1 204 No Content Date:

    Sat, 21 Jun 2014 23:21:12 GMT Server: Awesome Server Content-Length: 0 http://collector.site.com/beacon.img?a=1&b=2&c=3
  28. Now CDN  Node Origin Syslog  /  S3  /  FTP/etc Stream

    ed  W 3C  Log http://collector.site.com/beacon.img?a=1&b=2&c=3
  29. Summary:  CDN  is  an  extension  of  the  app • Flexible

     caching… • …and  uncaching • All  tail  sizes  should  perform  comparably! • Control  over  functionality  at  the  edge • Real  time  interfaces  for  programmability • Logic  at  the  edge • Real-­‐time  visibility • Real-­‐time  analytics
  30. The  future • Security  (more  now  than  future!) • Even

     more  at  the  edge • More  logic • Other  parts  of  applications • More  delivery  features