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
Monitorel - Web API for Server Resource Graph
Search
Yuuki Tsubouchi (yuuk1)
July 13, 2013
Programming
1
3.8k
Monitorel - Web API for Server Resource Graph
RRDtool in the hell
Yuuki Tsubouchi (yuuk1)
July 13, 2013
Tweet
Share
More Decks by Yuuki Tsubouchi (yuuk1)
See All by Yuuki Tsubouchi (yuuk1)
博士論文公聴会: Scaling Telemetry Workloads in Cloud Applications: Techniques for Instrumentation, Storage, and Mining / PhD Defence
yuukit
0
19
博士学位論文予備審査 / Scaling Telemetry Workloads in Cloud Applications: Techniques for Instrumentation, Storage, and Mining
yuukit
1
1.7k
MetricSifter:クラウドアプリケーションにおける故障箇所特定の効率化のための多変量時系列データの特徴量削減 / FIT 2024
yuukit
2
190
工学としてのSRE再訪 / Revisiting SRE as Engineering
yuukit
19
13k
Cloudless Computingの論文紹介
yuukit
2
480
#SRE論文紹介 Detection is Better Than Cure: A Cloud Incidents Perspective V. Ganatra et. al., ESEC/FSE’23
yuukit
3
1.8k
エンジニアのためのSRE論文への招待 / Introduction to SRE Papers for Engineers
yuukit
2
11k
博士課程での研究まとめ 2023年1月版 / Summary of my research in the PhD course
yuukit
1
280
AI時代に向けたクラウドにおける信頼性エンジニアリングの未来構想 / DICOMO2022 6A-1
yuukit
7
3k
Other Decks in Programming
See All in Programming
pylint custom ruleで始めるレビュー自動化
shogoujiie
0
140
データベースのオペレーターであるCloudNativePGがStatefulSetを使わない理由に迫る
nnaka2992
0
230
コードを読んで理解するko build
bells17
1
100
お前もAI鬼にならないか?👹Bolt & Cursor & Supabase & Vercelで人間をやめるぞ、ジョジョー!👺
taishiyade
7
4.1k
バッチを作らなきゃとなったときに考えること
irof
2
490
Introduction to kotlinx.rpc
arawn
0
750
『テスト書いた方が開発が早いじゃん』を解き明かす #phpcon_nagoya
o0h
PRO
8
2.2k
Boos Performance and Developer Productivity with Jakarta EE 11
ivargrimstad
0
100
.NET Frameworkでも汎用ホストが使いたい!
tomokusaba
0
190
Serverless Rust: Your Low-Risk Entry Point to Rust in Production (and the benefits are huge)
lmammino
1
140
Ruby on cygwin 2025-02
fd0
0
170
From the Wild into the Clouds - Laravel Meetup Talk
neverything
0
100
Featured
See All Featured
YesSQL, Process and Tooling at Scale
rocio
172
14k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
40
2k
Fontdeck: Realign not Redesign
paulrobertlloyd
83
5.4k
Producing Creativity
orderedlist
PRO
344
40k
Building Adaptive Systems
keathley
40
2.4k
BBQ
matthewcrist
87
9.5k
We Have a Design System, Now What?
morganepeng
51
7.4k
GitHub's CSS Performance
jonrohan
1030
460k
Fashionably flexible responsive web design (full day workshop)
malarkey
406
66k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
30
4.6k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5.2k
Into the Great Unknown - MozCon
thekraken
35
1.6k
Transcript
Monitorel Web API for server resource graph Kyoto.pm 5 Tech
Talk
HatenaJEZ@VVLJ Twitter!Z@VVL CPAN:66,* ͯͳΞϧόΠλʔ !γεςϜϓϥοτϑΥʔϜ෦ ʹ͓͍ͯ৽͘͠ 1FSMΛษڧ͠Α͏ͱ͢Δ ͖ͳϫΧϞϊ
Perl CPAN WebService::Qiita RRDTool::Rawish Plack::Middleware::GitStatus Net::Signalet vim-plugin unite-perl-module.vim perl-local-lib-path.vim
ἤΒΕΔKyoto.pm
ࠓͷ͓ αʔόϦιʔεՄࢹԽ ͭͬͨͭ͘ ( Monitorel ) αʔόϦιʔεΛάϥϑԽ͢ΔͨΊͷAPI
αʔόϦιʔε ҎԼͷΑ͏ʹ࣌ؒมԽ͢ΔͷΛɹɹɹɹɹ αʔόϦιʔεͱ͢Δ OS͔ΒͱΕΔͭ(load averageͱ͔CPU usage) ϛυϧΣΞ͔ΒͱΕΔͭ( MySQLͩͱ Connections, Qcache_hits,
Slow queries) 1ݸ1ݸͷΛϝτϦΫεͱ͢Δ ࣌ؒมԽ͠ͳ͍ͷΛϗετใͱ͢Δ IPΞυϨε, MACΞυϨε, ϚγϯεϖοΫͳͲ
αʔόϦιʔεՄࢹԽ Munin Cacti Zabbix Ganglia collectd etc...
Muninʢྫʣ
͚ࣾʹΧελϚΠζͨ͠Γ͢Δ ίʔυʹखΛೖΕΔͷ͕͍͠ɹ ʢ◦◦ݴޠͱ͔͞ΘΕͳ͍ʣɹɹɹɹɹ ʢόʔδϣϯΞοϓʹै͢Δͷ͕ ͍͠ʣ
ϑϧεΫϥον? http:/ /anond.hatelabo.jp/20120313004820
αʔόϦιʔεཧπʔϧߏཁૉ Server Server αʔόϦιʔε Λཧ͢ΔԿ͔ Web UI ϗετใཧ ͷͨΊͷDB Server
Server ϗετͷIPΞυϨε, MACΞυϨε, ϚγϯεϖοΫ, ϥοΫ൪߸ Graph image ϝτϦΫε
UIΛ͍͍ͨ͘͢͠ ϗετͷσʔλͷ࣋ͪํΛม͍͑ͨ ͚ͩͳͷʹ ϝτϦΫεͷऔಘɾอଘɾάϥϑԽͱ͔ ͷγεςϜ·Ͱ࡞Δͷͪΐͬͱ...
αʔόϦιʔεཧ͚ͩͬͯ͘ΕΔɹ ൚༻తͳπʔϧ ͕͋Ε͍͍ͷͰ
Monitorel Proof of Concept
Architecture Server Server Server ɾ ɾ ɾ Monitorel Web UI
HTTP request Graph image SNMP, HTTP, Telnet... DB (Hosts)
Architecture Server Server Server ɾ ɾ ɾ Monitorel API Job
Queue Web UI DB (Hosts) HTTP request Graph image Round Robin Database Graph image SNMP, HTTP, Telnet... rrd graph cron enqueue hosts list HTTP or SQL request enqueue job update metrics Monitorel
ࢥ αʔόϦιʔεऔಘɾอଘɾάϥϑԽ͚ͩΔ Web UIͱMonitorelHTTPͰ͠ΌΔ Web UIͷ࣮ݴޠͳΜͰΑ͍ Web UIʹؔ༩͠ͳ͍ ϗετใͷ࣋ͪํʹؔ༩͠ͳ͍ ϗετใΛཧ͢ΔDBϢʔβ͕ͭ͘Δ
Architecture Server Server Server ɾ ɾ ɾ Monitorel API Job
Queue Web UI DB (Servers) HTTP request Graph image Round Robin Database Graph image SNMP, HTTP, Telnet... rrd graph cron enqueue hosts list HTTP or SQL enqueue job update metrics Interface
Monitorel *OUFSGBDF Web UI - Monitorel API HTTPͰૄ݁߹ʹ͢Δ Applicationͷ࣮ݴޠRubyͰͳΜͰΑ͍ cron
enqueue - Job Queue DB(Hosts)Ͱཧ͞Ε͍ͯΔϗετͷɹ δϣϒΛQueueʹ͛Δ ఆظతʹcronͰ࣮ߦ HTTPͰδϣϒΛinsertͰ͖ΔΑ͏ʹ͍ͨ͠
Architecture Server Server Server ɾ ɾ ɾ Monitorel Web API
Job Queue Web UI DB (Hosts) HTTP request Graph image Round Robin Database Graph image SNMP, HTTP, Telnet... rrd graph cron enqueue hosts list HTTP or SQL enqueue job update metrics
Web API άϥϑͷϦΫΤετΛड͚͚ͯάϥϑը૾Λฦ͢ ͚ͩ ϦΫΤετύϥϝʔλʢͲͷϗετͷͲͷϝτϦ Ϋε͔, ظؒͳͲʣΛύʔε͢Δ Round Robin Databaseʹ͍߹Θͤͯάϥϑը૾
Խ
Architecture Server Server Server ɾ ɾ ɾ Web API Job
Queue Web UI DB (Servers) HTTP request Graph image Round Robin Database Graph image SNMP, HTTP, Telnet... rrd graph cron enqueue hosts list HTTP or SQL enqueue job update metrics
Job Queue ͳͥJob Queue ͔ ඞͣ͠Job QueueͰ͋Δඞཁͳ͍ αʔόʹର͢ΔωοτϫʔΫI/O͕ͪൃੜ͢Δ ͨΊɼඇಉظͰΓ͍ͨ Job
QueueΛͬͨେྔͷλεΫཧͷϊϋ ͕͋Δ ϚϧνϓϩηεͰৗற͢ΔσΟεύονϟͱҰॹʹ ͏ Parallel::PreforkͰ֤ϓϩηε͕ͦΕͧΕJobΛσΟ εύον SFGIUUQCMPHQPSHFOUSZ
Agent JobͷҰ෦ ϦϞʔταʔό͔ΒϝτϦΫεΛͱͬͯ͘Δͭ ରԠϛυϧΣΞɼϓϩτίϧ Apache, Nginx, MySQL, Munin, Latency, Plack,
Perlbal, Redis, SNMP, TheSchwartz ϓϥΨϒϧ Monitorel::Worker::Agent::Something SNMPHTTP, TelnetͰϝτϦΫεऔಘ
Architecture Server Server Server ɾ ɾ ɾ Web API Job
Queue Web UI DB (Servers) HTTP request Graph image Round Robin Database Graph image SNMP, HTTP, Telnet... rrd graph cron enqueue hosts list HTTP or SQL enqueue job update metrics
RRDtool
RRDTool RRD (Round Robin Database) ࣌ܥྻσʔλΛ֨ೲ͢ΔͨΊͷσʔλϑΥʔϚοτ อଘظؒΛݻఆͯ͠ݹ͍ࣺ͍ͯͯ͘ RRDtool RRDͷ࣮ʢσϑΝΫτελϯμʔυʣ RRDͷ࡞ɾߋ৽ɾࢀরػೳͱάϥϑԽػೳΛͭ
I/O͕ͨΒ͍(Β͍͠) େͷαʔόཧπʔϧͰΘΕ͍ͯΔ
CPAN Modules Web API Amon2 RRDTool Wrapper RRDTool::Rawish Job Queue
TheSchwartz or Qudo, Parallel::Prefork Agent IO::Socket::INET, Net::SNMP, Net::Telnet
Demo
TODO RRDtool͔Βͷ٫ʢRedisʣ ը૾Ͱͳ͘ϝτϦΫεΛJSONͰฦͯ͠JS Ͱάϥϑඳը AgentʹJVM, Solr, MongoDB, LVS,..., ͳͲՃ
Monitorel (POC) IUUQTHJUIVCDPNZVVLJ.POJUPSFM