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

AmebaとCDNのお付き合いの歴史 / ameba cdn waiwai

AmebaとCDNのお付き合いの歴史 / ameba cdn waiwai

kakerukaeru

January 31, 2019
Tweet

More Decks by kakerukaeru

Other Decks in Technology

Transcript

  1. CDN is... • Content Delivery Network ◦ Cache ◦ Dynamic

    Site Acceleration ◦ Security ◦ etc… ▪ Next protocol ▪ ImageOptimize ▪ Edge Cloud • programmable https://en.wikipedia.org/wiki/Content_delivery_network
  2. CDN is... • Cache ◦ Performance/capacity ▪ mod HTTP parameter

    • Header • path • protocol ▪ purge
  3. CDN is... • Dynamic Site Acceleration ◦ TCP Optimize ◦

    Routing Optimize ◦ TLS Termination ◦ Two-stage Edge ◦ Content compression https://blogs.akamai.com/jp/2017/05/bestpractice-web-perfromance0 https://docs.fastly.com/ja/guides/performance-tuning/shielding
  4. CDN is... • Security ◦ DDoS ◦ WAF ◦ Bot

    ◦ Security update https://twitter.com/FastlyJapan/status/1026682331547852800
  5. CDN is... • etc... ◦ CDN会社が深く関わるWeb標準 ▪ ESI / HTTP/2

    / QUIC ◦ Internet-Draft ▪ Cache Digest ▪ Early Hints ▪ Variants ▪ etc...
  6. CDN is... • Edge Cloud ◦ programable Eege ▪ Edge

    Worker @akamai ▪ Lambda@edge @aws ▪ fastly vcl ▪ Cloudflare Workers ◦ wasm on Edge ▪ wasm on Cloudflare Workers ▪ Fastly Labs
  7. CDN is... • で、なんだっけ ◦ GSLB + proxy(極論) ◦ しかも、CDNで出来るLayerが

    どんどん上がってきている ◦ ので、Amebaも少しずつLayerを 上げてCDNと共に歩んできた 話をします
  8. 02 DSA Connection 削減 tiered distribution enable keepalive new conn

    1/10000⤵ active con 1/10⤵ cpu usage 30% ⤵
  9. 04 Edge Cloud • programable CDN ◦ CI/CD with CircleCI

    ◦ test code with chai/mocha • log Base Realtime Monitoring ◦ logstream to Datadog
  10. 04 Edge Cloud • 全ResourcesへCDNを適用 ◦ 動的 & 静的 •

    normalize Cache Object ◦ Vary ◦ 1Cache Objectに 一つの意味のみ持たせる ▪ query/UA/method/Origin
  11. • Server Push ◦ Critical Rendering Path • originをより堅牢に ◦

    stale-while-revalidate ◦ stale-if-error • origin HMAC認証 • custom error page from synthetic Response 04 Edge Cloud @ こえのぶろぐ
  12. まとめと今後 • Performance & Capacityを 考える上でCDNは外せない • 全てのEndpointにCDNを ◦ originの関心事が減れば

    その分本質的な仕事ができる ◦ cpu Resourcesは あんまり 課金されない • CDNを入れる時は初期設計から必 ずCDNを見据えた形にする。