Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Fastlyのプログラマから見たCDN
Search
kazuho
April 13, 2018
Technology
29
18k
Fastlyのプログラマから見たCDN
#cdn_study 発表資料 (2018/4/13)
kazuho
April 13, 2018
Tweet
Share
More Decks by kazuho
See All by kazuho
HTTP優先度制御の今後とビデオ配信
kazuho
1
100
Encrypted SNI
kazuho
5
6.5k
Security, privacy, performance of next-generation transport protocols
kazuho
8
37k
TLS 1.3とその周辺の標準化動向
kazuho
0
9.2k
Other Decks in Technology
See All in Technology
コスト削減と精度維持を両立!類似画像検索システムの内製化成功事例
shutotakahashi
0
320
第27回クラウド女子会 ~re:Invent 振り返りLT会~ 宣言型ポリシー、使ってみたらこうだった!
itkr2305
0
270
世界の中心でApp Runnerを叫ぶ ~Aurora DSQLを添えて~
tsukuboshi
0
150
実践!生成AIのビジネス活用 / How to utilize Generative AI in your own business
gakumura
1
190
Plants vs thieves: Automated Tests in the World of Web Security
leichteckig
0
140
GDG Tokyo 生成 AI 論文をわいわい読む会
enakai00
0
240
reinvent2024を起点に振り返るサーバーレスアップデート
mihonda
1
160
15年入社者に聞く! これまでのCAのキャリアとこれから
kurochan
1
130
Tech Blog執筆のモチベート向上作戦
imamura_ko_0314
0
550
サーバレスの未来〜The Key to Simplifying Everything〜
kawaji_scratch
2
320
TSのコードをRustで書き直した話
askua
4
980
東京Ruby会議12 Ruby と Rust と私 / Tokyo RubyKaigi 12 Ruby, Rust and me
eagletmt
3
1.4k
Featured
See All Featured
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
44
9.4k
Writing Fast Ruby
sferik
628
61k
No one is an island. Learnings from fostering a developers community.
thoeni
19
3.1k
Site-Speed That Sticks
csswizardry
3
290
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
59k
Speed Design
sergeychernyshev
25
750
Building an army of robots
kneath
302
45k
Intergalactic Javascript Robots from Outer Space
tanoku
270
27k
Six Lessons from altMBA
skipperchong
27
3.6k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
Transcript
'BTUMZͷϓϩάϥϚ͔Βݟͨ$%/ Ԟ Ұึ ݄
• ۀͷ$%/ • ਓͷैۀһ • ੈք̓ϲॴʹΦϑΟε • 5CQTͷόϯυ෯ 'BTUMZͱ
• ݄ೖࣾ • 1SJODJQBM044&OHJOFFS – )551 5-4 26*$࣮ʮ)0ʯͷ։ൃ –
ͦΕΒϓϩτίϧͷඪ४Խ׆ಈʹࢀՃ ࣗݾհ
ຊ͓͢Δ༰$%/ͷதͷΤϯδχΞ ͔ΒݟͨݸਓతҙݟͰ͋Γɺࣾͱͯ͠ͷݟ ղΛࣔ͢ͷͰ͋Γ·ͤΜ ͓͜ͱΘΓ
• 'BTUMZͷ101ઃܭ • શੈքతͳࢄ,74 • &EHF$MPVE • ΠϯλʔωοτͷਐԽͱ$%/ ΞδΣϯμ
'BTUMZͷ101ઃܭ
$%/ʹΩϟογϡͤͨ͞΄͏͕͍ $%/ʹΩϟογϡͤͨ͞΄͏͕͍҆ ˣ ΩϟογϡώοτΛߴΊ͍ͨ $%/Λ͏ཧ༝
IUUQTXXXGBTUMZDPNOFUXPSLNBQ 101T
• ίϯϏχϞσϧ – Ϣʔβͷۙ͘ʹͨ͘͞Μͷ101 – ϝϦοτϨΠςϯγ • εʔύʔϚʔέοτϞσϧ –
*9ͷۙ͘ʹڊେͳ101 – ϝϦοτΩϟογϡώοτߴ ̎छྨͷϞσϧ
• Ωϟογϡώοτ͠ͳ͍ͳΒϨΠςϯγ ΛΔҙຯ͕ͳ͍ • NTϨΠςϯγ͕૿͑Δͱͯ͠ɺώο τͷߴ͍ڊେͳ101Λஔ͖͢ ˣ ڊେͳ101ͳΒͰͷٕज़త՝ͱ 'BTUMZεʔύʔϚέοτϞσϧ
• 101ຖͷΩϟύγςΟ ྫ – ࠷େ5CQTΫϥεͷωοτϫʔΫ • .314 –
ͷαʔόΫϥελ • (#ϝϞϦ • 5#44% • νϟϨϯδίετͱߴՄ༻ੑ 'BTUMZͷ101
ϧʔςΟϯά
IUUQTXXXGBTUMZDPNCMPHCVJMEJOHBOETDBMJOHGBTUMZOFUXPSLQBSUGJHIUJOHGJC ϧʔλϨεɾϧʔςΟϯά
ϩʔυόϥϯα L2SW L/B Server B Server A Server C
εςʔτϨεɾϩʔυόϥϯε L2SW Server B Server A Server C ECMP
(hash(ip:port))
εςʔτϨεɾϩʔυόϥϯε L2SW Server B Server A Server C ECMP
(hash(ip:port)) IUUQTXXXGBTUMZDPNCMPHCVJMEJOHBOETDBMJOHGBTUMZOFUXPSLQBSUCBMBODJOHSFRVFTUT
• ཁ݅ – ΫϥελͰ࠷̎ϊʔυ͕ॻࠐ – ฏۉXSJUFTTFDɾTFSWFS • )551Ϩεϙϯεͷ͕Ωϟογϡߋ৽ͱԾఆ •
ॻ͖ࠐΈ୯Ґʹ)551Ϩεϙϯε ൺֱతେ • 44%ͷ – ॻࠐϨΠςϯγ – ΣΞϨϕϦϯά 44%Ωϟογϡ
• ղܾࡦ – ಠࣗϑΝΠϧγεςϜ – Ұൠతͳ GTΑΓ؇͍Ұ؏ੑཁ݅ – 44%ͷಛੑʢྫϒϩοΫαΠζʣʹ࠷దԽ
44%Ωϟογϡ
• ϧʔςΟϯά • 5$1ͷνϡʔχϯά – ੍ޚɺ*/*5$8/% • ܧଓతͳϞχλϦϯάͱϑΟʔυόοΫ –
ੈք֤ʹϞχλϦϯάϊʔυ ωοτϫʔΫͷࢹͱνϡʔχϯά
ߴͳ)551࣮
• 'BTUMZͷ101ͷಛ – εʔύʔϚʔέοτϞσϧʢߴώοτʣ – ΧελϜιϑτΣΞʹΑΓ – ߴՁͳઐ༻ϋʔυΣΞΛ༻͍ͣʹ –
ߴՄ༻ੑͱߴޮੑΛ࣮ݱ • ϧʔςΟϯά • ϩʔυόϥϯε • ϑΝΠϧγεςϜ • ܧଓతͳࢹ – 5$1 5-4 )551Ϩϕϧͷνϡʔχϯά ·ͱΊ
શੈքతͳࢄ,74
• 7BSOJTI$POUSPM-BOHVBHF 7$- – )551ϦΫΤετͷॲཧΛΧελϚΠζ͢Δ ϓϩάϥϛϯάݴޠ sub vcl_miss
{ if (req.http.User-Agent ~ "Googlebot") { set req.backend = F_special_google_backend; } return(fetch); } ϓϩάϥϜՄೳͳ$%/
• ϦΫΤετͷϧʔςΟϯά • ϦΫΤετͷॻ • Ϩεϙϯεϔομͷॻ • ϦΫΤετͷ࠶ૹʢճ੍ݶ͋Γʣ •
ʜ 7$-ͰͰ͖Δ͜ͱ
• 63-Λࢦఆͯ͠ͷύʔδ • αϩήʔτɾΩʔΛࢦఆͯ͠ͷύʔδ – ಛఆͷΩʔ͕͍ͭͨΩϟογϡΛ·ͱΊͯ ύʔδ HTTP/1.1 200
OK Content-Type: text/html Content-Length: 1234 Surrogate-Key: mainpage template-a … Πϯελϯτɾύʔδ
• ϓϩάϥϜՄೳͳ$%/ • 63-Ͱࢀর͠ɺΩϟογϡ – ϦΫΤετॻʹΑΓҙͷΩʔͰࢀরՄೳ • ҙͷλΠϛϯάɾཻͰύʔδ શੈքతͳࢄ,74
4IJFMEJOH Origin NRT POP LHR POP SFO POP ITM
POP
• ٕज़ཁૉ – େ༰ྔͷΩϟογϡ – Πϯελϯτɾύʔδ – 4IJFMEJOH ۃΊͯߴ͍ΩϟογϡΛ࣮ݱՄೳ
&EHF$MPVE
• 8FC"QQMJDBUJPO'JSFXBMM – σϑΥϧτʴΧελϚΠζՄೳͳϧʔϧ • %%P4 – $%/ωοτϫʔΫ༰ྔ͕େ͖͍ •
খ͞ͳ%%P4ʹͳΒͳ͍ – %%P4ʹରԠ͢Δઐ༻ͷ4JOL ߈ܸରࡦ
• ը૾ͷαΠζɺ࣭ɺѹॖํࣜΛΫϥΠ Ξϯτຖʹ࠷దԽ ը૾࠷దԽ
<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
ϚΠΫϩαʔϏε߹ ೝূ IUUQTTQFBLFSEFDLDPNSZZTENJDSPTFSWJDFTPOGBTUMZ
ΠϯλʔωοτͷਐԽͱ$%/
• 5$1 • Σϒੜ • )551
• 5-4 • )551 • 5-4 ࣮࣭ 5-4 • 26*$ ࣮࣭ 5$1 Πϯλʔωοτϓϩτίϧͷྺ࢙
• ϓϩτίϧ্ͷ੍ݶ͕ϘτϧωοΫʹ • εϚʔτϑΥϯͷීٴ • $%/ͷຄڵ – ϓϩτίϧਐԽʹΫϥΠΞϯτ։ൃऀͱ αʔό։ൃऀͷ߹ҙ͕ඞཁ
– αʔό։ൃʹࢿ͢Δ৫ʹ$%/ • εϊʔσϯࣄ݅ ͳͥࠓͳͷ͔ r ͍͔ͭ͘ͷཧ༝
• શͯͷ௨৴Λ҉߸Խ – ϓϥΠόγʔอޢͱߗԽରࡦͷཱ྆ • ΑΓਝͳηοτΞοϓ – 355 1VTI
&BSMZ)JOUT • ωοτϫʔΫΛ·͍ͨͰ్Εͳ͍௨৴ – ଓͷϋϯυΦʔόʔͱϚϧνύεରԠ • ྼѱͳڥԼͰ೪Γڧ͘ – ϔουΦϒϥΠϯϒϩοΩϯάͷղܾɺલํ Τϥʔగਖ਼ ϓϩτίϧਐԽͷํੑ
• %/4PWFS)5514 – %/4ΫΤϦͷԠ$%/͔ΒɺηΩϡΞʹ • &BSMZ)JOUT$BDIF%JHFTUTGPS) – ΦϦδϯͷॲཧதʹ$%/͔ΒΞηοτΛ৴ •
4FSWFS5JNJOH – ϦΫΤετड৴ɺϨεϙϯεੜɺ৴λΠϛϯάΛ+4Ͱऔಘ • 4FDPOEBSZ$FSUJGJDBUFT – ̍ຊͷ5-4ଓͰෳͷূ໌ॻΛ༻ • 4IPSU5FSN$FSUT%FMFHBUFE$SFET – ൿີݤ࿙ӮͷӨڹΛ੍ݶ ݕӾରࡦؚΉ • 7BSJBOUT – 7BSZͷΩϟογϡരൃΛղܾ $%/ʹಛʹؔͷ͋Δϓϩτίϧ֦ு
26*$
26*$ IUUQTXXXJFUGPSHQSPDFFEJOHTTMJEFTTMJEFTRVJDQEG
• ʙ355Ͱͷଓཱ֬ • ϔουΦϒϥΠϯϒϩοΩϯάͷղܾ • ωοτϫʔΫΛ·͍ͨͰ్Εͳ͍ • ΑΓྑ͍ϓϥΠόγʔอޢ •
ਐԽΛଓ͚Δ௨৴ϓϩτίϧ – ΧʔωϧϧʔλͷӨڹΛഉআ • ΞοϓσʔτͰ͖ͳ͍σόΠεظతʹݟͯअ ຐʹͳΔ 26*$ͷඪ
• τϥϯεϙʔτͷઃܭݻ·Γͭͭ͋Δ – ݅ • ϋϯυγΣΠΫઃܭͷϦϑΝΫλ • ύέοτ൪߸҉߸Խ •
)551ʗϔομѹॖͷৄࡉ͜Ε͔Β 26*$ඪ४Խͷਐঢ়گ
26*$r ૬ޓଓࢼݧ
• .BSL/PUUJOHIBN – )551 26*$8(ٞ *"#ϝϯόʔ • +BOB*ZFOHBS –
*$$3(ٞ 26*$ඪ४ͷΤσΟλ • +PFM+BFHHMJ – /FUNPE 8(ٞ • .FMJOEB4IPSF – 5SBOT8( %*/3(ٞ *"#ϝϯόʔ 'BTUMZͱϓϩτίϧඪ४Խ
·ͱΊ
• ΑΓ҆͘ɺΑΓ͘ίϯςϯπΛ৴ – ߴ͍ΩϟογϡώοτΛ࣮ݱ • શੈքతͳࢄ,74 – ϓϩάϥϚϒϧͳ$%/ –
ॊೈͳ੍ޚ • &EHF$MPVE – ͞Βʹ༷ʑͳػೳΛఏڙ • ϓϩτίϧͷਐԽΛଅਐ – )551 5-4 26*$ $%/ͱͯ͠ͷϛογϣϯ