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
1
31
博士学位論文予備審査 / 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
490
#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
dbt Pythonモデルで実現するSnowflake活用術
trsnium
0
270
データベースのオペレーターであるCloudNativePGがStatefulSetを使わない理由に迫る
nnaka2992
0
240
Introduction to kotlinx.rpc
arawn
0
770
TCAを用いたAmebaのリアーキテクチャ
dazy
0
210
クリーンアーキテクチャから見る依存の向きの大切さ
shimabox
5
1.1k
Unity Android XR入門
sakutama_11
0
180
Bedrock Agentsレスポンス解析によるAgentのOps
licux
3
930
Datadog DBMでなにができる? JDDUG Meetup#7
nealle
0
150
AWS Step Functions は CDK で書こう!
konokenj
4
710
ABEMA iOS 大規模プロジェクトにおける段階的な技術刷新 / ABEMA iOS Technology Upgrade
akkyie
1
230
Learning Kotlin with detekt
inouehi
1
160
CSS Linter による Baseline サポートの仕組み
ryo_manba
1
160
Featured
See All Featured
The Art of Programming - Codeland 2020
erikaheidi
53
13k
Why You Should Never Use an ORM
jnunemaker
PRO
55
9.2k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
2.1k
Fontdeck: Realign not Redesign
paulrobertlloyd
83
5.4k
[RailsConf 2023] Rails as a piece of cake
palkan
53
5.3k
Building Applications with DynamoDB
mza
93
6.2k
A Modern Web Designer's Workflow
chriscoyier
693
190k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
134
33k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Music & Morning Musume
bryan
46
6.4k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
251
21k
Agile that works and the tools we love
rasmusluckow
328
21k
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