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
クラウドとオンプレ / on the Cloud or Premises
Search
Harukasan
PRO
March 12, 2015
Technology
5
9k
クラウドとオンプレ / on the Cloud or Premises
pixiv SPRING BOOTCAMP 2015 講義資料
Harukasan
PRO
March 12, 2015
Tweet
Share
More Decks by Harukasan
See All by Harukasan
pixivを支える技術 / 技育CAMPアカデミア
harukasan
PRO
3
400
20240401 新卒研修 - ピクシブにおける技術領域
harukasan
PRO
1
710
ピクシブのコンテンツ配信基盤技術 / pixiv TECH SALON
harukasan
PRO
5
5.4k
Goにおける画像ファイル処理 / golang.tokyo #19
harukasan
PRO
7
6.5k
WebRTC動画をトランスコードする / Transcoding video streams from WebRTC
harukasan
PRO
5
1.5k
ImageFluxを支えるリモート開発 / 20171202
harukasan
PRO
2
1.8k
YAPC::Fukuoka 前夜祭LT / Yet Another Pawoo Commit logs
harukasan
PRO
0
2.9k
YAPC::Fukuoka lunch session
harukasan
PRO
1
3k
マストドン会議: Pawoo / Mastodon Kaigi2
harukasan
PRO
2
440
Other Decks in Technology
See All in Technology
新機能VPCリソースエンドポイント機能検証から得られた考察
duelist2020jp
0
230
エンジニアカフェ忘年会2024「今年やらかしてしまったこと!」
keropiyo
0
100
Amazon Kendra GenAI Index 登場でどう変わる? 評価から学ぶ最適なRAG構成
naoki_0531
0
130
事業貢献を考えるための技術改善の目標設計と改善実績 / Targeted design of technical improvements to consider business contribution and improvement performance
oomatomo
0
150
サイボウズフロントエンドエキスパートチームについて / FrontendExpert Team
cybozuinsideout
PRO
5
38k
[Ruby] Develop a Morse Code Learning Gem & Beep from Strings
oguressive
1
190
pg_bigmをRustで実装する(第50回PostgreSQLアンカンファレンス@オンライン 発表資料)
shinyakato_
0
120
5分でわかるDuckDB
chanyou0311
10
3.3k
組織に自動テストを書く文化を根付かせる戦略(2024冬版) / Building Automated Test Culture 2024 Winter Edition
twada
PRO
18
5.6k
12 Days of OpenAIから読み解く、生成AI 2025年のトレンド
shunsukeono_am
0
170
Server-Side Engineer of LINE Sukimani
lycorp_recruit_jp
0
360
TypeScript開発にモジュラーモノリスを持ち込む
sansantech
PRO
2
680
Featured
See All Featured
4 Signs Your Business is Dying
shpigford
182
21k
Being A Developer After 40
akosma
87
590k
GitHub's CSS Performance
jonrohan
1031
460k
VelocityConf: Rendering Performance Case Studies
addyosmani
326
24k
Why Our Code Smells
bkeepers
PRO
335
57k
Gamification - CAS2011
davidbonilla
80
5.1k
Side Projects
sachag
452
42k
How to Think Like a Performance Engineer
csswizardry
22
1.2k
How To Stay Up To Date on Web Technology
chriscoyier
789
250k
Designing for Performance
lara
604
68k
Large-scale JavaScript Application Architecture
addyosmani
510
110k
Into the Great Unknown - MozCon
thekraken
34
1.5k
Transcript
ΫϥυͱΦϯϓϨ Shunsuke Michii / Harukasan 2015-03-11
Harukasan / Shunsuke Michii • 2012ʹ৽ଔͱͯ͠ΠϯϑϥνʔϜʹଐ • ίϯςϯπ৴Λ͡Ίͱͯ͠αʔϏεશମͷج൫Λ୲ • αʔϏεج൫͚ͩͰͳ͘σʔλղੳج൫ͷߏஙͳͲ
• ٕज़ܥࡶࢽͷࣥචͳͲ ϐΫγϒגࣜձࣾɹΠϯϑϥνʔϜ
Agenda • WebαʔϏεʹ͓͚ΔΠϯϑϥετϥΫνϟ • ΫϥυͱΦϯϓϨϛεͷҧ͍ • ΫϥελϦϯάͱΦʔέετϨʔγϣϯ
WebαʔϏεʹ͓͚Δ ΠϯϑϥετϥΫνϟ • ͦͦΠϯϑϥετϥΫνϟͱ • ΤϯδχΞϦϯάεέʔϧ͠ͳ͍ • ΠϯϑϥνʔϜͱ • ΠϯϑϥετϥΫνϟεέʔϧ͢Δ
Q1 ͋ͳ͕ͨWebαʔϏεΛઃܭ͢ΔͳΒ ͲͷΑ͏ͳߏΛߟ͑Δ͔ʁ
Application Application Database Cache Storage Application Application Load Balancer DNS
? ? ? ? ? ? ? ? Application Application
Database Cache Storage Application Application Load Balancer DNS
Server Server Server Server Server Local Network Internet Server Server
/ Appliance Server Server Application Application Database Cache Storage Application Application Load Balancer DNS
Heroku Add-on Add-on Add-on Application Add-on DNS Database Cache Storage
EC2 EC2 RDS ElastiCache S3 EC2 EC2 ELB Route53 Database
Cache Storage Application Application Application Application DNS Load Balancer
DNS
ͦͦ ΠϯϑϥετϥΫνϟͱ • αʔϏεΛӡ༻͢Δ্Ͱɺ߃ৗతʹඞཁͱͳΔج൫ • αʔϏεΛߏங͢Δ্ͰͱͳΔͷ • ࣗͰΒͳ͍ͱ͜Ζ
ΠϯϑϥετϥΫνϟ ͦΕࣗՁΛੜ·ͳ͍ • ຊʹՁ͕͋Δͷӡ༻͍ͯ͠ΔαʔϏεɺ͍҃ αʔϏε͕ఏڙ͍ͯ͠ΔͷͰ͋Δ • Πϯϑϥͱͯ͠ԿΛબ͢Δ͔ɺͲ͏͍͏ߏʹ͢ Δ͔ͱ͍ͬͨߏஙϊϋ͕ՁʹͳΔ͜ͱ͋Δ ͕ɺΠϯϑϥࣗମՁʹͳΒͳ͍
Ͳ͜ͰՁΛੜΉ͔ • ΠϯϑϥΑΓ্ͷϨΠϠʔͰՁΛੜΈग़͢ • ʢΤϯδχΞͱͯ͠ʣͲ͜ͰՁΛग़͔͕͢ॏཁ
Contents σβΠϯɾίʔσΟϯά ίϯςϯπࣥච DNS value value
DNS Contents Heroku Add-on Database Add-on Cache Add-on Storage Application
σβΠϯɾίʔσΟϯά ઃܭɾ։ൃ γεςϜઃܭ ίϯςϯπࣥච value value value value
ΤϯδχΞϦϯά εέʔϧ͠ͳ͍ • ࣗͷೳྗ͕ٸʹ100ഒʹͳΔ͜ͱͳ͍ • ʢΤϯδχΞͱͯ͠ʣͲ͜ͰՁΛग़͔͕͢ॏཁ
εέʔϧ͠ͳ͍ͷΛ࡞Βͳ͍ • 1ਓ͔͠ఏڙ͠ͳ͍αʔϏεͦΕҎ্ͷՁΛੜΊ ͳ͍ • ਓεέʔϧ͠ͳ͍͕ʢ͠ͳ͍ͷͰʣɺ༻͢Δਓ ͕ଟ͍΄Ͳ1ਓʹఏڙ͢ΔαʔϏεͷίετԼ͕Δ • εέʔϧ͢ΔϚʔέοτ͕͋Δ͔
ΠϯϑϥνʔϜͱ • αʔϏεΠϯϑϥΛ։ൃऀʹఏڙ͢Δ • ͬͯΔ͜ͱ֤ࣾΒΒ • ΠϯϑϥνʔϜࣗମ͕Πϯϑϥ
ΠϯϑϥνʔϜ Application
ʢۃΛݴ͏ͱʣࣗͷཱͪҐஔΑΓ ԼͷϨΠϠʔͯ͢Πϯϑϥ • ΠϯϑϥΤϯδχΞ͔ΒݟͨΒDCۀऀΠϯϑϥ • DCۀऀ͔ΒΈͯిؾࣄۀऀΠϯϑϥ • ։ൃऀ͔ΒΈͯΠϯϑϥΤϯδχΞΠϯϑϥ • ܦӦऀ͔ΒΈͯܧଓత։ൃΠϯϑϥʢʹࣄۀج൫ʣ
ΠϯϑϥετϥΫνϟ εέʔϧ͢Δ • ΠϯϑϥετϥΫνϟαʔϏεͱͯ͠εέʔϧ͢Δ • ύλʔϯԽͰ͖Δʹεέʔϧ͢Δ • εέʔϧ͢Ε͢Δ΄ͲίετϝϦοτ͕ग़Δ • ڊਓͷݞʹΔ
IaaS (Infrastructure as a Service) • WebαʔϏεͷΠϯϑϥετϥΫνϟΛαʔϏεͱ ͯ͠ఏڙ͢Δ • දతͳαʔϏεʹAWSɺGCPɺSoftLayerͳͲ
• ࣗࣾͷΠϯϑϥετϥΫνϟج൫ΛαʔϏεͱͯ͠ ఏڙ͍ͯ͠Δ
XaaS (X as a Service) • ͳΜͱ͔as a ServiceͱݺΕΔͷશ෦Πϯϑϥ ͳͷͰ·ͱΊͯIaaSͰΑ͍
• ͲͷϨΠϠʔ·Ͱఏڙ͍ͯ͠Δ͔Θ͔Βͳ͘ͳΔʢൺ ֱͰ͖ͳ͘ͳΔʣͷͰPaaSΈ͍ͨͳݴ༿͕ΘΕΔ
WebαʔϏεʹ͓͚Δ ΠϯϑϥετϥΫνϟ • ࣗͰΒͳ͍ͱ͜Ζ • ʢΤϯδχΞͱͯ͠ʣͲ͜ͰՁΛग़͔͕͢ॏཁ • ΠϯϑϥΛαʔϏεʹ͢Δͱεέʔϧ͢Δ ·ͱΊ:
break
IaaSͱΦϯϓϨ • ΦϯϓϨͱʁ • IaaSͱΦϯϓϨͷҧ͍
ΦϯϓϨϛε: On-Premises • ༁͢Δͱ"ߏʹ"ͱͳΔ • ͱͱࣾʹΠϯϑϥετϥΫνϟΛઃஔ͢Δ͜ ͱΛ͍ࣔͯͨ͠
ͳͥΦϯϓϨͱݴ͏ͷ͔ • Ϋϥυͷରٛޠ͕ͳ͔ͬͨ • Macͷରٛޠͱͯ͠ͷPC
ݱͷΦϯϓϨϛεڥ Ϋϥυʹ͍ۙ • ࣗࣾߏʹαʔό͓͍ͯΔͱ͜ΖͳΜͯ·Ε • ଏʹ”ΦϯϓϨ”ͱݺΕΔͱ͖αʔόIDCʹઃஔ ͯ͋͠Δ • ੈͷதͷ΄ͱΜͲͷΦϯϓϨ”ͳΜͪΌͬͯΦϯϓ Ϩϛε”ʹͳͬͯΔ
ຊͷΦϯϓϨϛε ͳΜͪΌͬͯΦϯϓϨϛε ઃஔॴ ࣗࣾDC ϗεςΟϯά αʔόઃஔɾཧ ࣗࣾ IDCɾϕϯμʔ ௐୡ ࣗࣾ
ࣗࣾɾϕϯμʔ ిݯ ࣗࣾܖ IDC ରࡦ ࣗࣾͰઃܭ IDC ճઢ ઐ༻ճઢ IDC ճઢࢹ ࣗࣾ IDC
Q2 IaaSͱΦϯϓϨϛεͷେ͖ͳҧ͍ͱʁ
IaaSͱΦϯϓϨͷҧ͍ • ͚ࣗͩͰ͏͔ɺΈΜͳͰ͏͔ • ͍ํ͕ҧ͏ͷͰ՝ۚମܥ͕େ͖͘ҟͳΔ
ΦϯϓϨͷௐୡ Load Infrastructure • ෛՙʹ߹ΘͤͯௐୡܭըΛཱͯΔ ௐୡλΠϛϯά ↓ ௐୡλΠϛϯά ↓ ௐୡλΠϛϯά
↓
Waste ΦϯϓϨͷௐୡ Load • ෛՙʹ߹ΘͤͯௐୡܭըΛཱͯΔ ௐୡλΠϛϯά ↓ ௐୡλΠϛϯά ↓ ௐୡλΠϛϯά
↓
ΦϯϓϨେม • ͏ͷશͯࣗͰ༻ҙࣗ͠Ͱӡ༻͢Δ • εέʔϧ͠ͳ͍ • ઌΛಡ·ͳ͍ͱ͍͚ͳ͍
IaaSͷௐୡ Load • ෛՙʹ߹Θͤͯ૿ݮͰ͖Δʢཧʣ
IaaSͷௐୡ Load • ෛՙʹ߹Θͤͯ૿ݮͰ͖Δʢݱ࣮ʣ
IaaS͚ͬ͜͏େม • ݁ہࣗͰεέʔϦϯά͢ΔΑ͏ʹ͠ͳ͚Εࣗಈ Ͱεέʔϧ͠ͳ͍ʢͪΐͬͱੲͷʣ • ୯Ձ͚ͩͰݟΕߴ͍
CPU୯Ձͷൺֱ • ʢඇެ։ʣ
ωοτϫʔΫ୯Ձͷൺֱ • ʢඇެ։ʣ
ίετͷҧ͍ • ୯Ձ͚ͩͰݟΕIaaSͷํ͕ߴͦ͏ʹݟ͑Δ • ࣮ࡍʹӡ༻ʹ͔͔Δਓ݅අɺDCΠϯϑϥʹ͔͔Δ ྉۚͳͲ͍ΖΜͳݻఆඅ͕͔͔Δ • େͷ߹IaaSͷํ͕εέʔϧϝϦοτͰ҆͘ͳΔ • ݻఆඅ͕খ͘͞ݟ͑Δ΄Ͳεέʔϧ͢ΕΦϯϓϨ
Ͱͬͨํ͕͍҆
IaaSͱΦϯϓϨ • ΦϯϓϨશ͕ͯࣗલͰͳ͍ʢͨΓલʣ • IaaSεέʔϧ͢Δ͜ͱͰϝϦοτΛग़͍ͯ͠Δ • CPU࣌ؒͰΈΔͱ͔ͳΓΑ͘ͳ͖ͬͯͨ • ωοτϫʔΫ͚ͬ͜͏ߴ͍ ·ͱΊ:
break
ΫϥελϦϯάͱ ΦʔέετϨʔγϣϯ • ΫϥελϦϯάͱΦʔέετϨʔγϣϯ • ͳͥΫϥελϦϯά͍ͨ͠ͷ͔ • ίϯςφΫϥελϦϯά
ΫϥελϦϯάͱ • ଟͷϦιʔεΛ1ͭͷϦιʔεͱͯ͠͏ • Ͱ͔͍Πϯελϯεߴ͍͠ɺSPOFʢ୯Ұোʣ ʹͳΔ • εέʔϦϯά͢Δʹ͍҆ϦιʔεΛͨ͘͞Μฒͯ 1ͭͷϦιʔεʹͯ͠Θͳ͍ͱ͍͚ͳ͍
ΦʔέετϨʔγϣϯͱ • Φʔέετϥͷԋํ๏ɺసͯ͡ฤɺ৫ԽΛ ࢦ͢୯ޠʹͳͬͨ • γεςϜ/ϛυϧΣΞͷࣗಈతͳߏཧɺσϓϩ Πϝϯτͷ͜ͱΛࢦ͢
ΫϥελϦϯά͍ͨ͠ • αʔϏεͷنΛ༧ଌ͢Δͷ͍͠ • ༻ҙ͍ͯ͠ΔΠϯϑϥΛ͙͢ʹೖ͍ͨ͠ • Ϋϥελશମͷ͏ܾͪ·ׂͬͨ߹ͷϦιʔεΛׂΓ ͍ͯͨ
ΦϯϓϨͷௐୡ Load • ෛՙʹ߹ΘͤͯௐୡܭըΛཱͯΔ ௐୡλΠϛϯά ↓ ௐୡλΠϛϯά ↓ ௐୡλΠϛϯά ↓
ʢ෮शʣ
Server Server Server Server Application Application Application Load balancer Application
Application
ΫϥελϦϯά͢ΔͨΊʹ ίϯςφΛ͏ • εέʔϧ͢ΔͨΊʹɺΞϓϦέʔγϣϯɺϛυϧΣ ΞɺઃఆͳͲ༷ʑͳͷΛσϓϩΠͯ͠ಈ࡞͢ΔΑ͏ ʹ͠ͳ͚ΕͳΒͳ͍ • ίϯςφ͝ͱσϓϩΠ͢Εྑ͍ =ΦʔέετϨʔγϣϯ͕؆୯
Docker • ίϯςφཧπʔϧ • DockerfileΛॻ͚ͩ͘ͰίϯςφΛϏϧυͰ͖Δ • ͍·ͷͱ͜ΖσϑΝΫτελϯμʔυ
dockerhub build push pull Dockerfile deployment Image
ͳͥίϯςφʹ͍ͨ͠ͷ͔ • ґଘؔΛύοέʔδϯά͍ͨ͠ • ։ൃऀ͕ϛυϧΣΞͷґଘؔΛཧ͢Δ͜ͱ͕ Ͱ͖ΔΑ͏ʹͳΔ • ίϯςφΛ͏ͱ͜Ε·ͰΠϯϑϥͩͬͨͷ͕ ΠϯϑϥͰͳ͘ͳΔ
Infrastructure Application
Infrastructure Application Container
ίϯςφԽ͞ΕΔͱԿ͕ى͜Δ͔ • ΠϯϑϥͷϨΠϠʔ͕1ͭԼ͕Δ • OSͷύοέʔδཧෆཁʹͳΔ • ίϯςφ͝ͱʹࢹ͕ඞཁʹͳΔ
CoreOS • ίϯςφϗετʹ࠷దԽ͞ΕͨLinuxσΟετϦ Ϗϡʔγϣϯ • systemdʹΑΔίϯςφͷཧͱEtcdɺFleetdͱ͍ͬ ͨΫϥελϦϯάɺΦʔέετϨʔγϣϯπʔϧ͔Β ߏ͞ΕΔ • ࣗಈతͳηΩϡϦςΟΞοϓσʔτ
ΦʔέετϨʔγϣϯ͕Γͳ͍ • ͍ͭ͘ίϯςφΛσϓϩΠ͢Δ͔ • ίϯςφؒͷ૬ޓଓͲ͏͢Δ͔ • ͲͷλΠϛϯάͰεέʔϧ͢Ε͍͍͔
Kubernates • Google͕ͭͬͨ͘ίϯςφΫϥελཧπʔϧ • αʔϏε୯ҐͰͷσϓϩΠ͕Ͱ͖Δ • ͍͍ͩͨશ෦ͷػೳ͕͋Δ͚ͲɺͰ͔͗͢Δ
ͦͦࣗͰΔҙຯ • ίϯςφΛσϓϩΠ͢ΔઌΛࣗલͰΒͳͯ͘ྑ ͍ͷͰ • ͋ΔఔͷεέʔϧʹͳΔͱࣗͰΔ͜ͱΛߟ͑Δ
ΫϥελϦϯάͱ ΦʔέετϨʔγϣϯ • Ͳ͜·Ͱ͕Πϯϑϥ͔࣌ʹΑͬͯมԽ͢Δ • ίϯςφΛ͏ͱ͍Ζ͍ΖͱมΘΓͦ͏ • ͍Ζ͍Ζͱߟ͑ͳ͍ͱ͍͚ͳ͍͜ͱ͕ଟ͍ ·ͱΊ:
·ͱΊ
ΫϥυͱΦϯϓϨ • ΫϥυͰ͋Δ͔Βͱ͔ɺΦϯϓϨͰ͋Δ͔Βɺ ͱ͍͏ͷ͋·Γେ͖ͳͰͳ͍ • ࠷࠷దͳج൫Λબ͢Δͷ͕Α͍ • ͩΊʹͳͬͨΒΓ͑Εྑ͍ • ʢΤϯδχΞͱͯ͠ʣͲ͜ͰՁΛग़͔͕͢ॏཁ