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
Mackerelチームにおけるインフラオーナーシップ / Hatena Pepabo tec...
Search
Ken Hamada
June 23, 2018
Technology
0
5.5k
Mackerelチームにおけるインフラオーナーシップ / Hatena Pepabo tech conf 4 DevOps Kyoto
Mackerelチームにおけるインフラオーナーシップ
Ken Hamada
June 23, 2018
Tweet
Share
More Decks by Ken Hamada
See All by Ken Hamada
組織と技術の両輪で開発を加速させるkintoneチームの取り組み / JJUG CCC 2022 Fall Cybozu kintone
itchyny
1
2.2k
サーバレスアーキテクチャによる時系列データベースの構築と監視 / Serverlessconf Tokyo 2017
itchyny
18
29k
Other Decks in Technology
See All in Technology
Cloud Service Mesh への期待が止まらない!!
phaya72
2
200
[RSJ24] Object Segmentation from Open-Vocabulary Manipulation Instructions Based on Optimal Transport Polygon Matching with Foundation Models
keio_smilab
PRO
0
130
App Router を実プロダクトで採用して見えてきた勘所をちょっとだけ紹介
marokanatani
0
690
EitherT_with_Future
aoiroaoino
1
930
Autonomous Database Cloud 技術詳細 / adb-s_technical_detail_jp
oracle4engineer
PRO
15
40k
HolidayJp.jl を作りました
mrkn
0
120
RAGHack: Building RAG apps in Python
pamelafox
0
150
Oracle Exadata Database Service(Dedicated Infrastructure):サービス概要のご紹介
oracle4engineer
PRO
0
9.4k
MySQLのあらたしいリリースモデル LTSとIR
sakaik
1
140
waitany と waitall を作った話
mrkn
0
120
The XZ Backdoor Story
fr0gger
0
2.6k
ことばをそろえる / Bridging the Terminology Gap
amaotone
5
1k
Featured
See All Featured
Building a Modern Day E-commerce SEO Strategy
aleyda
35
6.8k
How To Stay Up To Date on Web Technology
chriscoyier
785
250k
What's new in Ruby 2.0
geeforr
340
31k
A better future with KSS
kneath
235
17k
A Tale of Four Properties
chriscoyier
155
22k
Pencils Down: Stop Designing & Start Developing
hursman
118
11k
Writing Fast Ruby
sferik
623
60k
Docker and Python
trallard
39
3k
Web Components: a chance to create the future
zenorocha
308
41k
Faster Mobile Websites
deanohume
304
30k
Code Review Best Practice
trishagee
62
16k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
45
4.8k
Transcript
MackerelνʔϜʹ͓͚Δ ΠϯϑϥΦʔφʔγοϓ גࣜձࣾͯͳ id:itchyny 2018/6/23 ͯͳɾϖύϘٕज़େձ#4
ࣗݾհ גࣜձࣾͯͳ ΞϓϦέʔγϣϯΤϯδχΞ MackerelνʔϜ ࢛ ͖: Go, Rust, Scala, Haskell,
Vim ϓϩάϥϜϞάϞά itchyny.hatenablog.com ⅓ా ݈ id:itchyny
ϓϩάϥϜϞάϞά ද࡞: lightline.vim
ʮΠϯϑϥΦʔφʔγοϓʯ
ΠϯϑϥΦʔφʔγοϓ • ։ൃνʔϜ͕ΠϯϑϥͷΦʔφʔγοϓΛ࣋ͭ • ϞχλϦϯάɾϗετཧɾΩϟύγςΟϓϥϯχϯά ։ൃڥCIڥͷߏஙɾΠϯϑϥߏͷઃܭ • ΠϯϑϥνʔϜωοτϫʔΫͳͲͷڞ௨ج൫ʹઐ೦ • DevOpsͷ͋ΓํΛݟͨ݁͠Ռ
৴པੑͱඅ༻ΛαʔϏε։ൃνʔϜ͕Λ࣋ͭ
͜Ε·Ͱ • ΠϯϑϥνʔϜ (ԣ۲৫) ͕ݸʑͷαʔϏεΛ୲ • αʔόʔͷཧϞχλϦϯάΠϯϑϥϝϯόʔ͕୲ • αʔϏεʹΑͬͯٻΊΒΕΔΠϯϑϥ͕ࣝΒΒ •
Apache + mod_perl + MySQL ΦϯϓϨ ͷαʔϏε͕ଟ → Scala + PostgreSQL / Go on EC2, ECS, Lambda… • ٻΊΒΕΔ৴པੑ (Մ༻ੑ): ಛʹtoBtoBtoC
• Πϯϑϥϝϯόʔͷ୲αʔϏεͷࣄ͕ଟ͘ɺ ج൫γεςϜͷཧ։ൃ͕͓Ζ͔ͦʹ… • Πϯϑϥϝϯόʔͷ୲αʔϏεସ͕͑ࠔ • োରԠଞͷΠϯϑϥϝϯόʔʹ͍͠ • ։ൃνʔϜ͕Մ༻ੑΠϯϑϥඅ༻Λग़࣌͢ʹ
ΠϯϑϥνʔϜΛר͖ࠐ·ͳ͍ͱ͍͚ͳ͍
͜Ε͔Β • ։ൃνʔϜ͕αʔόʔ͔ΒϛυϧΣΞͷཧΛߦ͏ • αʔόʔߏங/ཧɾΩϟύγςΟϓϥϯχϯά ։ൃڥɾCIڥߏஙɾϞχλϦϯάɾোରԠ • αʔϏεͷ৴པੑͱඅ༻Λ֤։ൃνʔϜ͕ཧ • ΠϯϑϥνʔϜԾԽɾωοτϫʔΫج൫ɾOSΛ୲
։ൃνʔϜʹͱͬͯ • ΠϯϑϥࣝΛ͚͍͔ͭͯ͘͠ͳ͍ • αʔόʔΛཱͯΒΕΔΑ͏ʹͳΔ • దͳࢹΛઃఆͰ͖ΔΑ͏ʹͳΔ • োରԠͰ͖ΔΑ͏ʹͳΔ •
Մ༻ੑΛτϥοΩϯάͰ͖ΔΑ͏ʹͳΔ
։ൃνʔϜͲ͏͢Ε ΠϯϑϥͷΦʔφʔγοϓΛ ࣗ৴ΛͬͯऔΕΔΑ͏ʹͳΔͷ͔
Mackerel mackerel.io
Mackerelͱ • SaaSͷαʔόʔཧɾࢹπʔϧ • ͯͳࣾͷαʔόʔཧγεςϜΛαʔϏεԽͯ͠ެ։ • Mackerelࡾ • Scala +
Go / PostgreSQL + Redis
ݱࡏͷνʔϜͷମ੍ • ΞϓϦέʔγϣϯΤϯδχΞ໊ + σβΠφʔ + Director + Producer +
Sales + CRE • Πϯϑϥϝϯόʔ1ਓ͕νʔϜʹೖ͍ͬͯΔ • ேձνʔϜͷձٞʹࢀՃ • σεΫྡ: ίϛϡχέʔγϣϯେࣄ
ೖࣾͨ࣌͠ͷࢲ • ΣϒΞϓϦέʔγϣϯͷΈΛΒͳ͍ • SQLΛΒͳ͍ • LinuxΛΒͳ͍ (ͳ͔ͥMacΛ͍ͬͯΔ) • AWSΛΒͳ͍
• ίʔυͪΐͬͱॻ͚Δ (ͳ͔ͥHaskellͱVim͕͖)
ඞཁͳࣝ • ͦͦαʔόʔͱɺࢹͱ… • σβΠφʔʹجຊతͳ͜ͱཧղͯ͠Β͏ • LinuxɾWindowsͷγεςϜϝτϦοΫ • ֤छϛυϧΣΞͷಛࢹɾϝτϦοΫɾάϥϑͷݟํ •
ϚωʔδυαʔϏε • ֤छνϟοτπʔϧͱͷ࿈ܞɹChefɾAnsible • rpm/debϦϙδτϦɾWindows msi
υοάϑʔσΟϯά • MackerelνʔϜ࠷ߴͷυοάϑʔσΟϯά͕Ͱ͖Δ • ࡞͍ͬͯΔαʔϏεΛΔ → ࣗͷαʔϏεΛࢹ͢Δ • ࢹ͍ͯ͠ͳ͍ͱ͜Ζ͕͔Δ →
࡞Δ → ࢹΛ࢝ΊΔ • ։ൃΤϯδχΞසൟʹը໘ΛݟΔ • ۀʹΈࠐΉ·Ͱ͕ػೳ։ൃ ྫ: σϓϩΠͰάϥϑΞϊςʔγϣϯ • ଞνʔϜͷ։ൃΤϯδχΞMackerelΛΑ͘͏
σϓϩΠ • σϓϩΠ୲ͷΤϯδχΞΛॱ൪ʹΞαΠϯ • ୲ΤϯδχΞμογϡϘʔυΛॱ൪ʹݟ͍ͯ͘ • ීஈͷϝτϦοΫͷ༷ࢠΛΔ܇࿅ ࢹ͢Δ = ҟৗঢ়ଶΛఆΊΔ
= ීஈΛΔ • σϓϩΠΠϯϑϥΛݟΔྑ͍ػձ • σϓϩΠͱɺͲ͜ʹԿΛͲ͏͢Δ͜ͱͳͷ͔ʁ • σϓϩΠίϚϯυͷཪଆͰԿ͕ى͖͍ͯΔͷ͔ʁ
MackerelνʔϜͷΤϯδχΞ ීஈͷ։ൃΛ͠ͳ͕Β ΠϯϑϥΛֶΜͰ͍Δ ֶ͟ΔΛಘͳ͍αʔϏεΛ࡞͍ͬͯΔ
͍߹Θͤͷྫ • MySQL/DockerϓϥάΠϯͰϝτϦοΫ͕औಘͰ͖ͳ͍ • ϒϥβʔͰݟΕΔͷʹ֎ܗࢹͰΤϥʔ͕ग़Δ • CPU steal͕100%ʹுΓ͍͍ͯΔ • WindowsͰprocess
queue length͕औΕ͍ͯͳ͍ • loadavg͕7࣌ؒ͝ͱʹ্ঢ͢Δ ֤छϛυϧΣΞOSɺ֎ܗࢹͰDNSͷΈͳͲͷ͕ࣝΘΕΔ
https://mackerel.io/ja/blog/entry/tech/high-loadavg-every-7-hours
αϙʔτ୲ • αϙʔτ͔ΒͷௐࠪґཔΛड͚ΔΤϯδχΞΛॱ൪ʹ୲ • ຖि୲Λճͯ͠શһ͕͋ͨΔ • ͔Βͳ͚Εଞͷਓͱڞʹௐࠪɾݟͷڞ༗ • ෆ۩߹ͷൃݟ मਖ਼ผλεΫͱͯ͠issueΛཱͯΔ
؆୯ͳͷ͍ͭͰʹ͢͜ͱ͋Δ
αϙʔτ୲Λճ͢͜ͱͰ Βͳ͍ػೳϛυϧΣΞΛֶͿ ௐࠪํ๏ɾΠϯϑϥࣝͷԣల։ loadavgʹ͍ͭͯҟৗʹৄ͘͠ͳͬͨΓ͢Δ
PWG • Performance Working Group • ύϑΥʔϚϯεͷ֬ೝɾى͖ͨোͱରࡦਐḿͷ֬ೝ • ࢀՃऀΠϯϑϥΤϯδχΞͱ։ൃΤϯδχΞશһ •
࢘ձ୲Λॱ൪ʹճ͢: ϝϯόʔͷཧղΛਂΊΔ ฉ͚ͩ͘ΑΓɺ࢘ձͱͯ͠આ໌͢Δ͜ͱͰཧղ • άϥϑΛݟΔίʔφʔ
োରԠৼΓฦΓ • োͷৼΓฦΓͱผʹɺରԠͨ͠खॱͳͲΛ֬ೝ • ଐਓੑ: ܦݧଟ͍ΤϯδχΞ͕ҰॠͰͯ͠͠·͏ ԿΛࢥͬͯԿΛͲ͏ݟͯͲͷΑ͏ʹஅ͔ͨ͠ • ͲͷάϥϑΛݟ͔ͨɺͲͷαʔόʔͷϩάΛݟ͔ͨ •
ରԠ͠ͳ͔ͬͨਓ͕stagingͰ࣮ࡍʹखॱΛ࠶ݱ • ো࣌ͷௐࠪͷͨΊͷΈͮ͘Γ ϩάཧը໘ͷվળɾμογϡϘʔυ࡞ͳͲ োى͖ͯཉ͘͠ͳ͍͕ɺى͖ͨͱ͖ଟ͘ͷֶͼΛಘΔ
Մ༻ੑɾίεττϥοΩϯά • Մ༻ੑ: ো͝ͱʹه͠ɺPWGͰ֬ೝ • ։ൃνʔϜ͕ظ͝ͱʹඪΛ࣋ͭ • SLAެ։Λࢦ͢ • ίετ:
ΠϯϑϥϝϯόʔͱσΟϨΫλʔ͕֬ೝձ • ։ൃϝϯόʔAWS cost explorerͰ֬ೝͰ͖Δ • Node.js 6.10→8.10 Ͱ Lambdaͷίετ1ׂݮ
None
ϚωʔδυαʔϏε • ࣌ܥྻσʔλϕʔε: LambdaɾDynamoDBɾS3 • Πϯϑϥ৮Γ͘͢ͳ͖͍ͬͯͯΔ • ΩϟύγςΟʔมߋ୭ͰͰ͖Δ࣌ • ʮ࣌ܥྻσʔλϕʔεݟڞ༗ձʯ
• ։ൃΤϯδχΞࣗવͱίετΛݟΔΑ͏ʹͳΔ • Cost ExplorerͰreportΛඋ
ίϯςφԽ • deploy / rollback͕ѹతʹָʹͳΔ • ΦʔτεέʔϧΛߟྀͨ͠ίϯςφج൫ • ࣾͷChefڞ௨ج൫ͷґଘΛࣙΊΒΕΔ •
ϞχλϦϯάؚΊͯࠓͷ՝ • MackerelͷίϯςφରԠ։ൃதͰ͢ • Dockerfileͱ͍͏ڞ௨ݴޠɾϛυϧΣΞͱͷଓΛએݴతʹߦ͏
࠷ۙͷMackerelνʔϜͷձ • DevʮݴͬͯͨϓϥάΠϯͷόάͨ͠ͷͰΞοϓσʔτ͓͍ͯͨ͠ʯ OpsʮͲͲʯ • Devʮ͜͜ϝτϦοΫݟ͓͚ͯΑͦ͞͏ͳͷͰࢹ࡞͓͍ͬͯͨΑʯ Opsʮྃղʯ • DevʮલݴΘΕͯͨ৽ػೳ࣮ͨ͠Αʙʯ Opsʮͬͨʔศརʙʯ
• Opsʮstagingͷ΄͛΄͛ΛίϯςφԽ͠·ͨ͠ʯ Devʮ͗͢͢͝Δʯ
·ͱΊ • ΠϯϑϥΛֶͿͷָ͍͠ • ٕज़ͷਐาͰΠϯϑϥཧָʹͳ͖͍ͬͯͯΔ • ௐୡɾεέʔϧΞτɾϩʔϧόοΫAPIͰͰ͖Δ࣌ • ιϑτΣΞʹΑͬͯࣗಈԽ͞ΕΔ࣌ •
ΠϯϑϥΤϯδχΞωοτϫʔΫ/OSͷϨΠϠʔʹઐ೦ • ΦϖϨʔγϣϯπʔϧΛ͘͢࡞ΕΔਓڧ͍
αʔϏεզ͕ࢠ
None