Fastlyのプログラマから見たCDN

A1f8ed12fefd7759ef8838e62ee409a6?s=47 kazuho
April 13, 2018

 Fastlyのプログラマから見たCDN

#cdn_study 発表資料 (2018/4/13)

A1f8ed12fefd7759ef8838e62ee409a6?s=128

kazuho

April 13, 2018
Tweet

Transcript

  1. 'BTUMZͷϓϩάϥϚ͔Βݟͨ$%/ Ԟ Ұึ ೥݄

  2.  • ೥૑ۀͷ$%/ • ໿ਓͷैۀһ • ੈք̓ϲॴʹΦϑΟε • 5CQTͷόϯυ෯ 'BTUMZͱ͸

  3.  • ೥݄ೖࣾ • 1SJODJQBM044&OHJOFFS – )551 5-4 26*$࣮૷ʮ)0ʯͷ։ൃ –

    ͦΕΒϓϩτίϧͷඪ४Խ׆ಈʹࢀՃ ࣗݾ঺հ
  4.  ຊ೔͓࿩͢Δ಺༰͸$%/ͷதͷΤϯδχΞ ͔ΒݟͨݸਓతҙݟͰ͋Γɺࣾͱͯ͠ͷݟ ղΛࣔ͢΋ͷͰ͸͋Γ·ͤΜ ͓͜ͱΘΓ

  5.  • 'BTUMZͷ101ઃܭ • શੈքతͳ෼ࢄ,74 • &EHF$MPVE • ΠϯλʔωοτͷਐԽͱ$%/ ΞδΣϯμ

  6.  'BTUMZͷ101ઃܭ

  7.  $%/ʹΩϟογϡͤͨ͞΄͏͕଎͍ $%/ʹΩϟογϡͤͨ͞΄͏͕͍҆ ˣ Ωϟογϡώοτ཰ΛߴΊ͍ͨ $%/Λ࢖͏ཧ༝

  8.  IUUQTXXXGBTUMZDPNOFUXPSLNBQ 101T

  9.  • ίϯϏχϞσϧ – Ϣʔβͷۙ͘ʹͨ͘͞Μͷ101 – ϝϦοτ௿ϨΠςϯγ • εʔύʔϚʔέοτϞσϧ –

    *9ͷۙ͘ʹڊେͳ101 – ϝϦοτΩϟογϡώοτ཰ߴ ̎छྨͷϞσϧ
  10.  • Ωϟογϡώοτ͠ͳ͍ͳΒϨΠςϯγ Λ࡟Δҙຯ͕ͳ͍ • ਺NTϨΠςϯγ͕૿͑Δͱͯ͠΋ɺώο τ཰ͷߴ͍ڊେͳ101Λ഑ஔ͢΂͖ ˣ ڊେͳ101ͳΒͰ͸ͷٕज़త՝୊ͱ͸ 'BTUMZ͸εʔύʔϚέοτϞσϧ

  11.  • 101ຖͷΩϟύγςΟ ྫ  – ࠷େ5CQTΫϥεͷωοτϫʔΫ • ໿.314 –

    ୆ͷαʔόΫϥελ • (#ϝϞϦ • 5#44% • νϟϨϯδίετͱߴՄ༻ੑ 'BTUMZͷ101
  12.  ϧʔςΟϯά

  13.  IUUQTXXXGBTUMZDPNCMPHCVJMEJOHBOETDBMJOHGBTUMZOFUXPSLQBSUGJHIUJOHGJC ϧʔλϨεɾϧʔςΟϯά

  14.  ϩʔυόϥϯα L2SW L/B Server B Server A Server C

  15.  εςʔτϨεɾϩʔυόϥϯε L2SW Server B Server A Server C ECMP

    (hash(ip:port))
  16.  εςʔτϨεɾϩʔυόϥϯε L2SW Server B Server A Server C ECMP

    (hash(ip:port)) IUUQTXXXGBTUMZDPNCMPHCVJMEJOHBOETDBMJOHGBTUMZOFUXPSLQBSUCBMBODJOHSFRVFTUT
  17.  • ཁ݅ – Ϋϥελ಺Ͱ࠷௿̎ϊʔυ͕ॻࠐ – ฏۉXSJUFTTFDɾTFSWFS • )551Ϩεϙϯεͷ͕Ωϟογϡߋ৽ͱԾఆ •

    ॻ͖ࠐΈ୯Ґʹ)551Ϩεϙϯε ൺֱతେ • 44%ͷ໰୊ – ॻࠐϨΠςϯγ – ΢ΣΞϨϕϦϯά 44%Ωϟογϡ
  18.  • ղܾࡦ – ಠࣗϑΝΠϧγεςϜ – Ұൠతͳ GTΑΓ؇͍Ұ؏ੑཁ݅ – 44%ͷಛੑʢྫϒϩοΫαΠζʣʹ࠷దԽ

    44%Ωϟογϡ
  19.  • ϧʔςΟϯά • 5$1ͷνϡʔχϯά – ᫔᫓੍ޚɺ*/*5$8/% • ܧଓతͳϞχλϦϯάͱϑΟʔυόοΫ –

    ੈք֤஍ʹϞχλϦϯάϊʔυ ωοτϫʔΫͷ؂ࢹͱνϡʔχϯά
  20.  ߴ଎ͳ)551࣮૷

  21.  • 'BTUMZͷ101ͷಛ௃ – εʔύʔϚʔέοτϞσϧʢߴώοτ཰ʣ – ΧελϜιϑτ΢ΣΞʹΑΓ – ߴՁͳઐ༻ϋʔυ΢ΣΞΛ༻͍ͣʹ –

    ߴՄ༻ੑͱߴޮ཰ੑΛ࣮ݱ • ϧʔςΟϯά • ϩʔυόϥϯε • ϑΝΠϧγεςϜ • ܧଓతͳ؂ࢹ – 5$1 5-4 )551Ϩϕϧͷνϡʔχϯά ·ͱΊ
  22.  શੈքతͳ෼ࢄ,74

  23.  • 7BSOJTI$POUSPM-BOHVBHF 7$-  – )551ϦΫΤετͷॲཧΛΧελϚΠζ͢Δ ϓϩάϥϛϯάݴޠ sub vcl_miss

    { if (req.http.User-Agent ~ "Googlebot") { set req.backend = F_special_google_backend; } return(fetch); } ϓϩάϥϜՄೳͳ$%/
  24.  • ϦΫΤετͷϧʔςΟϯά • ϦΫΤετͷॻ׵ • Ϩεϙϯεϔομͷॻ׵ • ϦΫΤετͷ࠶ૹʢճ਺੍ݶ͋Γʣ •

    ʜ 7$-ͰͰ͖Δ͜ͱ
  25.  • 63-Λࢦఆͯ͠ͷύʔδ • αϩήʔτɾΩʔΛࢦఆͯ͠ͷύʔδ – ಛఆͷΩʔ͕͍ͭͨΩϟογϡΛ·ͱΊͯ ύʔδ HTTP/1.1 200

    OK Content-Type: text/html Content-Length: 1234 Surrogate-Key: mainpage template-a … Πϯελϯτɾύʔδ
  26.  • ϓϩάϥϜՄೳͳ$%/ • 63-Ͱࢀর͠ɺΩϟογϡ – ϦΫΤετॻ׵ʹΑΓ೚ҙͷΩʔͰࢀরՄೳ • ೚ҙͷλΠϛϯάɾཻ౓Ͱύʔδ શੈքతͳ෼ࢄ,74

  27.  4IJFMEJOH Origin NRT POP LHR POP SFO POP ITM

    POP
  28.  • ٕज़ཁૉ – େ༰ྔͷΩϟογϡ – Πϯελϯτɾύʔδ – 4IJFMEJOH ۃΊͯߴ͍Ωϟογϡ཰Λ࣮ݱՄೳ

  29.  &EHF$MPVE

  30.  • 8FC"QQMJDBUJPO'JSFXBMM – σϑΥϧτʴΧελϚΠζՄೳͳϧʔϧ • %%P4 – $%/͸ωοτϫʔΫ༰ྔ͕େ͖͍ •

    খ͞ͳ%%P4͸໰୊ʹͳΒͳ͍ – %%P4ʹରԠ͢Δઐ༻ͷ4JOL ߈ܸରࡦ
  31.  • ը૾ͷαΠζɺ඼࣭ɺѹॖํࣜΛΫϥΠ Ξϯτຖʹ࠷దԽ ը૾࠷దԽ

  32.  <div id="content"> <div id="header"> <img src="/images/logo.jpg" /> <esi:include src="/shopping_cart"

    /> </div> <div id="items"> <span id="item_1">...</span> <span id="item_2">...</span>… <span id="item_3">...</span>… <span id="item_4">...</span>… &EHF4JEF*ODMVEFT
  33.  ϚΠΫϩαʔϏε߹੒ ೝূ IUUQTTQFBLFSEFDLDPNSZZTENJDSPTFSWJDFTPOGBTUMZ

  34.  ΠϯλʔωοτͷਐԽͱ$%/

  35.  •  5$1 •  ΢Σϒ஀ੜ •  )551

    •  5-4 •  )551 •  5-4 ࣮࣭ 5-4 •  26*$ ࣮࣭ 5$1 Πϯλʔωοτϓϩτίϧͷྺ࢙
  36.  • ϓϩτίϧ্ͷ੍ݶ͕ϘτϧωοΫʹ • εϚʔτϑΥϯͷීٴ • $%/ͷຄڵ – ϓϩτίϧਐԽʹ͸ΫϥΠΞϯτ։ൃऀͱ αʔό։ൃऀͷ߹ҙ͕ඞཁ

    – αʔό։ൃʹ౤ࢿ͢Δ૊৫ʹ$%/ • εϊʔσϯࣄ݅  ͳͥࠓͳͷ͔ r ͍͔ͭ͘ͷཧ༝
  37.  • શͯͷ௨৴Λ҉߸Խ – ϓϥΠόγʔอޢͱߗ௚Խରࡦͷཱ྆ • ΑΓਝ଎ͳηοτΞοϓ – 355 1VTI

    &BSMZ)JOUT • ωοτϫʔΫΛ·͍ͨͰ΋్੾Εͳ͍௨৴ – ઀ଓͷϋϯυΦʔόʔͱϚϧνύεରԠ • ྼѱͳ؀ڥԼͰ΋೪Γڧ͘ – ϔουΦϒϥΠϯϒϩοΩϯάͷղܾɺલํ Τϥʔగਖ਼ ϓϩτίϧਐԽͷํ޲ੑ
  38.  • %/4PWFS)5514 – %/4ΫΤϦͷԠ౴΋$%/͔ΒɺηΩϡΞʹ • &BSMZ)JOUT$BDIF%JHFTUTGPS) – ΦϦδϯͷॲཧதʹ$%/͔ΒΞηοτΛ഑৴ •

    4FSWFS5JNJOH – ϦΫΤετड৴ɺϨεϙϯεੜ੒ɺ഑৴λΠϛϯάΛ+4Ͱऔಘ • 4FDPOEBSZ$FSUJGJDBUFT – ̍ຊͷ5-4઀ଓͰෳ਺ͷূ໌ॻΛ࢖༻ • 4IPSU5FSN$FSUT%FMFHBUFE$SFET – ൿີݤ࿙ӮͷӨڹΛ੍ݶ ݕӾରࡦؚΉ • 7BSJBOUT – 7BSZͷΩϟογϡരൃ໰୊Λղܾ $%/ʹಛʹؔ܎ͷ͋Δϓϩτίϧ֦ு
  39.  26*$

  40.  26*$ IUUQTXXXJFUGPSHQSPDFFEJOHTTMJEFTTMJEFTRVJDQEG

  41.  • ʙ355Ͱͷ઀ଓཱ֬ • ϔουΦϒϥΠϯϒϩοΩϯάͷղܾ • ωοτϫʔΫΛ·͍ͨͰ΋్੾Εͳ͍ • ΑΓྑ͍ϓϥΠόγʔอޢ •

    ਐԽΛଓ͚Δ௨৴ϓϩτίϧ – Χʔωϧ΍ϧʔλͷӨڹΛഉআ • ΞοϓσʔτͰ͖ͳ͍σόΠε͸௕ظతʹݟͯअ ຐʹͳΔ 26*$ͷ໨ඪ
  42.  • τϥϯεϙʔτͷઃܭ͸ݻ·Γͭͭ͋Δ – ࢒݅ • ϋϯυγΣΠΫઃܭͷϦϑΝΫλ • ύέοτ൪߸҉߸Խ •

    )551ʗϔομѹॖͷৄࡉ͸͜Ε͔Β 26*$ඪ४Խͷਐ௙ঢ়گ
  43.  26*$r ૬ޓ઀ଓࢼݧ

  44.  • .BSL/PUUJOHIBN – )551 26*$8(ٞ௕ *"#ϝϯόʔ • +BOB*ZFOHBS –

    *$$3(ٞ௕ 26*$ඪ४ͷΤσΟλ • +PFM+BFHHMJ – /FUNPE 8(ٞ௕ • .FMJOEB4IPSF – 5SBOT8( %*/3(ٞ௕ *"#ϝϯόʔ 'BTUMZͱϓϩτίϧඪ४Խ
  45.  ·ͱΊ

  46.  • ΑΓ҆͘ɺΑΓ଎͘ίϯςϯπΛ഑৴ – ߴ͍Ωϟογϡώοτ཰Λ࣮ݱ • શੈքతͳ෼ࢄ,74 – ϓϩάϥϚϒϧͳ$%/ –

    ॊೈͳ੍ޚ • &EHF$MPVE – ͞Βʹ༷ʑͳػೳΛఏڙ • ϓϩτίϧͷਐԽΛଅਐ – )551 5-4 26*$  $%/ͱͯ͠ͷϛογϣϯ