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
大規模Webサービス入門 14回目 / Introduction to large scale...
Search
muttan
August 31, 2017
Technology
0
120
大規模Webサービス入門 14回目 / Introduction to large scale web service 14
muttan
August 31, 2017
Tweet
Share
More Decks by muttan
See All by muttan
さわやか待ち時間LINE botを作った話 / Sawayaka LINE bot
bath_poo_
0
97
コンテナ開発入門 1回目/Introduction to Container Development 1
bath_poo_
0
130
ISUCONってなんだ / What is ISUCON
bath_poo_
0
310
Web技術の基本 8回目 / Introduction to Web technologies 8th class
bath_poo_
0
160
Web技術の基本 7回目 / Introduction to Web technologies 7th class
bath_poo_
0
140
Web技術の基本 6回目 / Introduction to Web technologies 6th class
bath_poo_
1
230
Web技術の基本 5回目 / Introduction to Web technologies 5th class
bath_poo_
0
110
Web技術の基本 4回目 / Introduction to Web technologies 4th class
bath_poo_
0
190
Web技術の基本 3回目 / Introduction to Web technologies 3rd class
bath_poo_
0
230
Other Decks in Technology
See All in Technology
ついに出た!OpenAIの最新モデル「o1」って何がすごいの?
minorun365
PRO
3
1.1k
サプライチェーン攻撃に備える
ryunen344
0
290
開発生産性を始める前に開発チームができること / optim-improve-development-productivity.pdf
optim
0
110
サーバー管理しないサーバーサービスManaged DevOps Pool
kkamegawa
0
130
DuckDB雑紹介(1.1対応版)@DuckDB座談会
ktz
6
1.4k
ネットワークだけ隔離されたコンテナ作成デモ / Kichijoji.pm36
tenforward
1
230
言葉は感情の近似値である。その感情と言葉の誤差を最小化しよう ~コミュニケーションにおけるアナログ/デジタル変換の課題に立ち向かう~
nktamago
0
230
QAに対する超個人的な解釈 / Personal Take on QA
toma_sm
1
100
再考 アクターモデル/ reconsider actor model
ytake
0
360
技術的負債解消の取り組みと専門チームのお話
bengo4com
0
330
20240911_New_Relicダッシュボード活用例
speakerdeckfk
0
110
株式会社EventHub・エンジニア採用資料
eventhub
0
2.9k
Featured
See All Featured
Why You Should Never Use an ORM
jnunemaker
PRO
53
8.9k
Web development in the modern age
philhawksworth
205
10k
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
The Art of Programming - Codeland 2020
erikaheidi
48
13k
BBQ
matthewcrist
83
9.2k
From Idea to $5000 a Month in 5 Months
shpigford
379
46k
Imperfection Machines: The Place of Print at Facebook
scottboms
263
13k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
24
610
Building Adaptive Systems
keathley
36
2.1k
The Language of Interfaces
destraynor
153
23k
Designing for Performance
lara
604
68k
Raft: Consensus for Rubyists
vanstee
135
6.5k
Transcript
େنαʔϏεٕज़ೖ ୈ14ճ ISUCONରࡦษڧձ 2017/8/31
ୈ14ճ ޮ্࡞ઓ - ϋʔυΣΞͷϦιʔεͷ༻Λ্͛Δ -
ԾԽٕज़ɾࣗ࡞αʔό • Ұൠతʹ, ԽΛਐΊΔͱϦιʔεͷ༻ Լ͢Δ. ‣ ن͕খ͚͞Εখ͍͞΄ͲݦஶʹͳΔ ‣ αʔό͕2, 3ͷγεςϜʹ1,
2ͷ༨༟Λͨ ͤΑ͏ͱ͢Δͱ, Ϧιʔε༻େ͖͘མͪΔ
ԾԽٕज़ɾࣗ࡞αʔό • Λղܾ͢ΔͨΊʹ, ҎԼͷ2ͭΛߦͳ͏. 1. ԾԽٕज़ ‣ ϗετͷूੵΛ্ঢͤ͞Δ. 2. ࣗ࡞αʔό
‣ ࠷దͳߏͰͷαʔόΛߏ͢Δ.
Lesson 36 ԾԽٕज़
ԾԽٕज़ͷಋೖ
ԾԽٕज़ͷಋೖͷత • εέʔϥϏϦςΟ ˠ Φʔόʔϔουͷ࠷খԽ • ίετύϑΥʔϚϯε ˠ Ϧιʔε༻ͷ্ɾӡ༻ͷ୯७Խ •
ߴՄ༻ੑ ˠ ڥͷִ
ԾԽٕज़ͷಋೖͷత • εέʔϥϏϦςΟ ˠ Φʔόʔϔουͷ࠷খԽ • ίετύϑΥʔϚϯε ˠ Ϧιʔε༻ͷ্ɾӡ༻ͷ୯७Խ •
ߴՄ༻ੑ ˠ ڥͷִ
ԾԽٕज़ͷಋೖ • ࢢʹ༷ʑͳԾԽͷ͕͋Δ. • Xen • VMWare • Parallels •
etc..
ԾԽٕज़ͷޮ༻
ԾԽٕज़ͷޮ༻ 1. IPMIͷସͱͯ͠ͷϋΠύʔόΠβ 2. ϋʔυࠩͷٵऩ 3. ४ԾԽΛ༻ 4. Ϧιʔεফඅͷ੍ޚ
IPMIͷସͱͯ͠ͷϋΠύʔόΠβ • ϕϯμͷαʔόʹ, IPMI(Intelligent Platform Management Interface)͕උΘ͍ͬͯΔ. ‣ ϦϞʔτͰγεςϜΛཧ(ON, OFFͱ͔)͢Δͨ
Ίͷඪ४ΠϯλϑΣʔεͰ͋Δ. ‣ ϕϯμOSؒʹґଘ͢Δ͜ͱͳ͘ૢ࡞͢ΔͨΊ ͷΠϯλϑΣʔε
IPMIͷସͱͯ͠ͷϋΠύʔόΠβ • ϋΠύʔόΠβʔ͍ΘΏΔϗετOS ‣ ϗετOS αʔό্Ͱ࠷ॳʹىಈ͢ΔOS ‣ ήετOS ϗετOS্Ͱىಈ͢ΔOS
IPMIͷସͱͯ͠ͷϋΠύʔόΠβ • ڱٛͷϋΠύʔόΠβʔ(Xen) ϋʔυΣΞ্ͰϓϩάϥϜΛՔಇ͢Δํ ࣜ • ٛͷϋΠύʔόΠβʔ(VMWare) OS্ͰΞϓϦέʔγϣϯιϑτͱͯ͠Քಇ͠ɺ ͦͷ্Ͱ༷ʑͳOSΛಈ࡞Ͱ͖ΔΑ͏ʹ͢Δͷ Ҿ༻ɿhttps://www.idcf.jp/words/hypervisor.html
IPMIͷସͱͯ͠ͷϋΠύʔόΠβ • IPMIͷΘΓʹϋΠύʔόΠβΛར༻͢Δ. ‣ IPMI͕ࡌ͞Ε͍ͯͳ͍҆ՁͳϋʔυΣ ΞΛͬͯαʔόΛߏங͢Δࣄ͕Ͱ͖Δ.
ϋʔυࠩͷٵऩ • ڥΛநԽ͍ͯ͠Δ. ‣ ৽͍͠ϋʔυݹ͍ϋʔυͰࠩΛؾʹ ͤͣʹ༻͢Δ͜ͱ͕ग़དྷΔ.
४ԾԽͷ༻ • XenʹಛԽͨ͠ • ४ԾԽͱશԾԽͱݴ͏ͷ͕ଘࡏͯ͠ ͍Δ. • ࠓճ४ԾԽ
४ԾԽͷ༻ • શԾԽιϑτΣΞͰϋʔυΣΞΛ શʹγϛϡϨʔτ͢Δ. ‣ Φʔόʔϔου͕͋ΔͨΊಈ࡞͍·͍ͪ • ४ԾԽ, ޮͷྑ͍ԾϋʔυΛ࠶ఆٛ͢Δ. ‣
OSϨϕϧͰमਖ਼Λߦ͏ඞཁ͕͋Δ.
४ԾԽͷ༻ • ಋೖίετ શԾԽʼ४ԾԽ • ύϑΥʔϚϯε શԾԽʻ४ԾԽ
Ϧιʔεফඅͷ੍ޚ • ϦιʔεফඅΛιϑτΣΞϨϕϧͰڧྗʹ ੍ޚ͢Δࣄ͕Մೳ. ‣ monitͱ͍͏ϦιʔεཧπʔϧΛ͏ ‣ ʮաෛՙͷΞϥʔτʯͱʮෛՙͷௐʯΛ ߦͳ͏
Ϧιʔεফඅͷ੍ޚ • πʔϧͰҎԼͷΑ͏ͳ͜ͱΛࣗಈԽ ‣ աෛՙ࣌ʹ࠶ىಈΛߦͳ͏. ‣ ϩʔυΞϕϨʔδ, ίωΫγϣϯ, ϝϞϦফඅ ྔͷࢹ.
‣ ᮢΛ͑ͨΒApacheͷ࠶ىಈ
Ϧιʔεফඅͷ੍ޚ • πʔϧͰҎԼͷΑ͏ͳ͜ͱΛࣗಈԽ ‣ աෛՙ࣌ʹ࠶ىಈΛߦͳ͏. ‣ ϩʔυΞϕϨʔδ, ίωΫγϣϯ, ϝϞϦফඅ ྔͷࢹ.
‣ ᮢΛ͑ͨΒApacheͷ࠶ىಈ
ԾԽαʔόͷߏஙϙϦγʔ
ԾԽαʔόͷߏஙϙϦγʔ • ԾԽٕज़ͷ1൪ͷత ˠ ϋʔυΣΞϦιʔεͷར༻ޮ্ • ۭ͍͍ͯΔϦιʔεΛ͏ήετOSΛೖΕΔ • ͲͷΑ͏ͳαʔόΛಋೖ͢Δ͔
ԾԽαʔόͷߏஙϙϦγʔ • CPUϦιʔε͕ۭ͍͍ͯΔ ˠ Webαʔό • I/OϦιʔε͕ۭ͍͍ͯΔ ˠ DBαʔό •
ϝϞϦϦιʔε͕ۭ͍͍ͯΔ ˠ Ωϟογϡαʔό Ϧιʔεͷফඅ͕ࣅ͍ͯΔͷಉ࢜ڞଘͤ͞ͳ͍΄͏͕ྑ͍.
ԾԽαʔό(Webαʔό)ͷྫ • 4GBͷϝϞϦΛࡌ͍ͯ͠Δαʔό͕͋ͬͨ ͱ͖, 3.5GBΛWebαʔό༻ͷήετOSʹׂ Γ͍ͯͯΔͱ͢Δ. • ࠷ۙجຊ8GBͰߏ͢ΔͷͰ, ήετ OS(Webαʔό)Λ5.5GB,
ήετ OS(memcached༻)ʹ2GBׂΓͯΔ.
ԾԽαʔό(Webαʔό)ͷྫ 8FCαʔό ϝϞϦɿ4GB Dom0ɿ0.5GB WebSVɿ3.5GB WebαʔόओʹCPUΛফඅ 8FCαʔό Ωϟογϡαʔό ϝϞϦɿ8GB Dom0ɿ0.5GB
WebSVɿ5.5GB Cashɿ2GB ΩϟογϡαʔόओʹϝϞϦΛফඅ
ԾԽαʔό(DBαʔό)ͷྫ • DBαʔόͷಛ ‣ ϝϞϦফඅ͢Δ. ‣ CPUϦιʔεͱI/OϦιʔεͦΕ΄Ͳফඅ͠ͳ͍. → Webαʔό༻ͷήετOSΛಉډͤͯ͞, I/Oͱ
CPUϦιʔεΛ͏͜ͱͰϦιʔε༻ޮΛ্ ͛Δ.
ԾԽαʔό(DBαʔό)ͷྫ %#αʔό ϝϞϦɿ4GB Dom0ɿ0.5GB WebSVɿ3.5GB DBαʔόI/Oෛՙ͕ߴ͍ %#αʔό 8FCαʔό ϝϞϦɿ8GB Dom0ɿ0.5GB
WebSVɿ5.5GB Cashɿ2GB WebαʔόCPUϦιʔεΛফඅ
ԾԽʹΑͬͯಘΒΕͨ ϝϦοτͷখ·ͱΊ
ԾԽͷϝϦοτখ·ͱΊ • ཧతͳϦιʔε੍͔Βͷ։์ ‣ Ϧιʔεͷಈతͳมߋ VMͷϚΠάϨʔγϣϯෳ → ༰қͳαʔό૿ઃ ͞ΒͳΔεέʔϥϏϦςΟ →
ϋʔυΣΞɾӡ༻ίετͷԼ ҟৗಈ࡞࣌ͷہॴԽɾϗετͷ੍ޚ͕༰қ → ίεύͷ্ɺߴՄ༻ੑ
ԾԽͷҙ
ԾԽͷσϝϦοτ • ύϑΥʔϚϯε্ͷΦʔόʔϔου͕͋Δ. • CPUͰ2ʙ3% • ϝϞϦੑೳͷ10% • ωοτϫʔΫੑೳͷ50% •
I/Oੑೳ͕5%͘Β͍མͪΔ • ಈ࡞͕ෆ҆ఆʢωοτϫʔΫͳͲʣ
Lesson 37 ϋʔυΣΞͱޮ্ - ίετΛ࣮ݱ͢Δཁૉٕज़ -
ϓϩηοαͷੑೳ্
ϓϩηοαͷੑೳ্ • ʮूੵճ࿏্ͷτϥϯδελ18ϲ݄͝ͱ ʹഒʹͳΔʢϜʔΞͷ๏ଇʣ Ҿ༻ɿhttps://www.semiconportal.com/archive/blog/insiders/oowada/post-205.html
ϓϩηοαͷੑೳ্ • ϜʔΞͷ๏ଇτϥϯδελूੵͷͰ͋Γ, ٕज़తʹ·ͩ·ͩ৳ͼ͍ͯΔ • ίΞ୯ମͰͷੑೳݶք͕དྷ͍ͯΔͱߟ͑ΒΕ ͍ͯΔ͕, ϝχʔίΞ͕ͨΓલͱͳ͓ͬͯΓ, ͜Ε͔Β૿͑ΔΜͩΖ͏. •
࠷ۙAMD͕Ξπ͍
ϝϞϦɾHDDͷίετԼ
ϝϞϦɾHDDͷίετԼ • ϝϞϦɾHDD҆͘ͳ͍ͬͯΔʢେӕʣ ‣ 2007 2GBͰ3ສԁ ‣ 2010 2GB*2Ͱ5ઍԁఔ ‣
2017 4GB1ຕͰ4100ԁ͙Β͍͔Β…
ϝϞϦɾHDDՁ֨ͷਪҠ http://www2s.biglobe.ne.jp/~sakharov/research/graph.html
ϝϞϦɾHDDՁ֨ͷਪҠ • ϝϞϦ্͕Γ͍ͯ͠Δ. • http://akiba-pc.watch.impress.co.jp/docs/ price/monthly_repo/1072428.html • NANDͷڙڅෆͬΆ͍ʁ • HDDՁ͕֨Լ͕͍ͬͯΔ.
҆Ձͳϋʔυͷ༗ޮར༻
҆Ձͳϋʔυͷ༗ޮར༻ • ཧػೳΛ࠷খݶʹ • ίΞͰ͖Δ͚ͩଟ͘ͷͷΛ • ϝϞϦ͍҆(ཁग़య)ͷͰΨϯΨϯੵΉ • I/OٻΊΒΕΔཁ݅ʹΑͬͯม͑Δ •
σΟεΫϨεαʔό • RAID10(RAID1+RAID0), SSDͰRAID0(ετϥΠϐϯά)
҆Ձͳϋʔυͷ༗ޮར༻ • IPMIΛࡌ͢Δͱ, 1ʙ2ສԁ΄Ͳߴ͘ͳΔ. ‣ Intel AMTͰସ ‣ ԾԽ(ϋΠύʔόΠβʔ)Ͱཧ͢Δ
SSDͷ׆༻Օॴ • ͯͳͰ, DBͷεϨʔϒαʔόͰΘΕΔ͜ͱ ͕ଟ͍. ‣ ϝϞϦ32GB+HDDͷͱ͖ͱ, ϝϞϦ8GB+SSDͱ ͍͏ߏͩͱಉ༷ͷύϑΥʔϚϯεʹͳͬͨΓ ͢Δ…
‣ ϝϞϦ > SSD > HDD RAID-0/10 > HDD RAID-1