Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Monitorel - Web API for Server Resource Graph

Monitorel - Web API for Server Resource Graph

RRDtool in the hell

Yuuki Tsubouchi (yuuk1)

July 13, 2013
Tweet

More Decks by Yuuki Tsubouchi (yuuk1)

Other Decks in Programming

Transcript

  1. αʔόϦιʔε ҎԼͷΑ͏ʹ࣌ؒมԽ͢Δ΋ͷΛɹɹɹɹɹ αʔόϦιʔεͱ͢Δ OS͔ΒͱΕΔ΍ͭ(load averageͱ͔CPU usage) ϛυϧ΢ΣΞ͔ΒͱΕΔ΍ͭ( MySQLͩͱ Connections, Qcache_hits,

    Slow queries) 1ݸ1ݸͷ஋ΛϝτϦΫεͱ͢Δ ࣌ؒมԽ͠ͳ͍΋ͷΛϗετ৘ใͱ͢Δ IPΞυϨε, MACΞυϨε, ϚγϯεϖοΫͳͲ
  2. αʔόϦιʔε؅ཧπʔϧߏ੒ཁૉ Server Server αʔόϦιʔε Λ؅ཧ͢ΔԿ͔ Web UI ϗετ৘ใ؅ཧ ͷͨΊͷDB Server

    Server ϗετͷIPΞυϨε, MACΞυϨε, ϚγϯεϖοΫ, ϥοΫ൪߸ Graph image ϝτϦΫε
  3. Architecture Server Server Server ɾ ɾ ɾ Monitorel Web UI

    HTTP request Graph image SNMP, HTTP, Telnet... DB (Hosts)
  4. 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
  5. 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
  6. Monitorel *OUFSGBDF Web UI - Monitorel API HTTPͰૄ݁߹ʹ͢Δ Applicationͷ࣮૷ݴޠ͸RubyͰ΋ͳΜͰ΋Α͍ cron

    enqueue - Job Queue DB(Hosts)Ͱ؅ཧ͞Ε͍ͯΔϗετ਺෼ͷɹ δϣϒΛQueueʹ౤͛Δ ఆظతʹcronͰ࣮ߦ HTTPͰδϣϒΛinsertͰ͖ΔΑ͏ʹ͍ͨ͠
  7. 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
  8. 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
  9. Job Queue ͳͥJob Queue ͔ ඞͣ͠΋Job QueueͰ͋Δඞཁ͸ͳ͍ αʔόʹର͢ΔωοτϫʔΫI/O଴͕ͪൃੜ͢Δ ͨΊɼඇಉظͰ΍Γ͍ͨ Job

    QueueΛ࢖ͬͨେྔͷλεΫ؅ཧͷϊ΢ϋ΢ ͕͋Δ ϚϧνϓϩηεͰৗற͢ΔσΟεύονϟͱҰॹʹ ࢖͏ Parallel::PreforkͰ֤ϓϩηε͕ͦΕͧΕJobΛσΟ εύον SFGIUUQCMPHQPSHFOUSZ
  10. Agent JobͷҰ෦ ϦϞʔταʔό͔ΒϝτϦΫεΛͱͬͯ͘Δ΍ͭ ରԠϛυϧ΢ΣΞɼϓϩτίϧ Apache, Nginx, MySQL, Munin, Latency, Plack,

    Perlbal, Redis, SNMP, TheSchwartz ϓϥΨϒϧ Monitorel::Worker::Agent::Something SNMP΍HTTP, TelnetͰϝτϦΫεऔಘ
  11. 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
  12. CPAN Modules Web API Amon2 RRDTool Wrapper RRDTool::Rawish Job Queue

    TheSchwartz or Qudo, Parallel::Prefork Agent IO::Socket::INET, Net::SNMP, Net::Telnet