1. Muninで始める実践★リソース監視
俺のサ バがこんなに重いはずがない、を乗り切るために
- 俺のサーバがこんなに重いはずがない、を乗り切るために -
Practical Resource Monitoring with Munin
I Think Munin Is Truly Wonderful
Munin User G oup Japa http://munin.jp/
u Use Group Japan ttp // u jp/
Masahito Zembutsu @zembutsu
Sep 8, 2012 , オープンソースカンファレンス 2012 Tokyo/Fall
9. ―Don't forget. always, somewhere,
someone is fighting for you.
―As long as you remember her
As her.
you are not alone.
Operation
運用
忘れないで、いつもどこかで誰かがあなたの為に戦っている。
彼女を覚えている限り、あなたは一人じゃない。
彼女を覚え 限り あなたは 人じ な
(出典:魔法少女まどかマギカ最終話「わたしの、最高の友達」)
Monitoring
監視
10. ※こんな職場のイメージです
This Photo is under creative commons license by torkildr
http://www.flickr.com/photos/torkildr/3462606643/sizes/l/in/photostream/
11. A HUMAN WORK
ホスティングサービス業務
サーバの形、心の形。見知らぬ、仕様書。光、そして影。
クラウド、来日。変わる業界。まごころを、お客様へ。
DECISIVE BATTLE
障害対応
鳴り止まない電話。静止したデータセンタの中で。
優先度の選択を。電源停止に至る病、そして。
営業、侵入。客先訪問、魂の座。嘘と沈黙。涙。
You can advance.
次世代ニーズに向けた挑戦
特科サポート部隊、誕生。奇跡の価値は。せめて人間らしく。
18. Munin.jp
• Munin User Group Japan
– http://munin.jp/
• Wiki
iki
– http://munin.jp/wiki/
• Demo
– http://demo.munin.jp/
• メーリングリスト
– http://munin.jp/mailing-list/
37. 障害対応のありかたが変わった
かつて いま (present day present time, hahaha!!)
• 1台や数台構成 • 複数台が前提
• Apache, Sendmail, Perl • 従来 境
従来環境
• PostgreSQL, MySQL +nginx,Tomcat,ruby,PHP,Py
• たまにアプライアンスあり thon,memcached,Key-Value
Store,Hadoop,Cassandra,M
St H d C d M
• スケールしない ongoDB…etc(仲間が増える
• スペックアップで解決する よポポポポーン♪)
• スペックアップで解決しない
事が多い
44. Munin
シャキ ン( ω
シャキーン(`・ω・´)
)
• http://munin-monitoring.org/
– リソース監視ツール
• トレンドの変化を解析できる
• 何が性能を殺しているのか? が分かる
– プラグアンドプレイな設計
• 標準で、多くのグラフを表示できる
Munin is a networked resource monitoring tool that can help analyze resource trends and
g p y
"what just happened to kill our performance?" problems. It is designed to be very plug and
play. A default installation provides a lot of graphs with almost no work.
70. Muninが持つ、様々なプラグイン
• システムリソース
– CPU、メモリ、Load Average、ディスク関連
g
• ネットワーク
– トラフィック、SNMP、HTTP 読み込み時間
• ミドルウェア・アプリケーション
– Apache, Nginx, Sendmail, Postfix, MySQL,
PostgreSQL, M
P t SQL MongoDB, memcached, PHP etc
DB h d PHP… t
76. 動作環境
• 基本 Perl5 が動作する環境
• OS
– Linux
• Source code ( version 2.0.6 )
• Binary Package
– Red Hat Enterprise Linux 系 ( EPEL )
– Debian
– openSUSE
– MacOS X
– Windows
86. プラグインのデバッグ
• /usr/sbin/munin-run <プラグイン名>
– --debug オプションを付与すると、更に細かい
g
– munin-node の再起動をしなくとも、同じ挙動
• コマンドラインツール
– muninwalk & muninget (perl script)
https://github.com/zembutsu/muninwalk
h // i h b / b / i lk
125. References
• Munin
– http://munin-monitoring.jp/
• M i U G J
Munin User Group Japan
– http://munin.jp/
– http://munin.jp/wiki/
• Website
– Waiting for Munin 2.0 ‒ Introduction ‒ Personal Workflow Blog
• http://blog.pwkf.org/post/2010/06/Waiting-for-Munin-2.0-Introduction
– /tags/2 0 0/ChangeLog ‒ Munin ‒ Trac
/tags/2.0.0/ChangeLog
• http://munin-monitoring.org/browser/tags/2.0.0/ChangeLog