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)
MetricSifter:クラウドアプリケーションにおける故障箇所特定の効率化のための多変量時系列データの特徴量削減 / FIT 2024
yuukit
2
120
工学としてのSRE再訪 / Revisiting SRE as Engineering
yuukit
19
11k
Cloudless Computingの論文紹介
yuukit
2
420
#SRE論文紹介 Detection is Better Than Cure: A Cloud Incidents Perspective V. Ganatra et. al., ESEC/FSE’23
yuukit
3
1.5k
エンジニアのためのSRE論文への招待 / Introduction to SRE Papers for Engineers
yuukit
2
11k
博士課程での研究まとめ 2023年1月版 / Summary of my research in the PhD course
yuukit
1
250
AI時代に向けたクラウドにおける信頼性エンジニアリングの未来構想 / DICOMO2022 6A-1
yuukit
7
2.9k
AIOps研究録―SREのための システム障害の自動原因診断 / SRE NEXT 2022
yuukit
10
12k
Interactive AIOps
yuukit
0
2.1k
Other Decks in Programming
See All in Programming
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
1
100
Ethereum_.pdf
nekomatu
0
460
Jakarta Concurrencyによる並行処理プログラミングの始め方 (JJUG CCC 2024 Fall)
tnagao7
1
290
A Journey of Contribution and Collaboration in Open Source
ivargrimstad
0
900
『ドメイン駆動設計をはじめよう』のモデリングアプローチ
masuda220
PRO
8
540
ふかぼれ!CSSセレクターモジュール / Fukabore! CSS Selectors Module
petamoriken
0
150
C++でシェーダを書く
fadis
6
4.1k
카카오페이는 어떻게 수천만 결제를 처리할까? 우아한 결제 분산락 노하우
kakao
PRO
0
110
Jakarta EE meets AI
ivargrimstad
0
540
RubyLSPのマルチバイト文字対応
notfounds
0
120
GitHub Actionsのキャッシュと手を挙げることの大切さとそれに必要なこと
satoshi256kbyte
5
430
Jakarta EE meets AI
ivargrimstad
0
150
Featured
See All Featured
Become a Pro
speakerdeck
PRO
25
5k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
47
2.1k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.1k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
364
24k
Producing Creativity
orderedlist
PRO
341
39k
Fashionably flexible responsive web design (full day workshop)
malarkey
405
65k
How To Stay Up To Date on Web Technology
chriscoyier
788
250k
Bash Introduction
62gerente
608
210k
Gamification - CAS2011
davidbonilla
80
5k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.1k
Scaling GitHub
holman
458
140k
A designer walks into a library…
pauljervisheath
204
24k
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