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
Mackerel's monitoring and checks
Search
i2tsuki
November 29, 2017
Technology
1
7k
Mackerel's monitoring and checks
Monitoring Seminar in mercari で Mackerel 自身のモニタリング & 監視についてお話しました。
i2tsuki
November 29, 2017
Tweet
Share
More Decks by i2tsuki
See All by i2tsuki
ソーシャルゲームの長期運用 を目指すための SRE の取り組み - 10 周年を⽬指すコトダマンの場合 -
i2tsuki
5
2.6k
AWS Startup.fm 企業の上場時に必要な監査要件とマネジメントサービスによる解決
i2tsuki
0
100
BuildKit を使った Scala アプリケーションのテストと高速化 @ Docker Meetup Kansai #2
i2tsuki
1
590
20180530LINEDeveloperMeetupRedis-redis-for-mackerelio
i2tsuki
0
470
Mackerel インフラ基盤 AWS 移行の舞台裏
i2tsuki
6
10k
Python Web Application Monitoring in Mackerel
i2tsuki
1
6k
Other Decks in Technology
See All in Technology
Oracle Cloud Infrastructure:2025年6月度サービス・アップデート
oracle4engineer
PRO
2
310
KubeCon + CloudNativeCon Japan 2025 Recap by CA
ponkio_o
PRO
0
260
KiCadでPad on Viaの基板作ってみた
iotengineer22
0
180
マーケットプレイス版Oracle WebCenter Content For OCI
oracle4engineer
PRO
3
940
LangChain Interrupt & LangChain Ambassadors meetingレポート
os1ma
2
230
fukabori.fm 出張版: 売上高617億円と高稼働率を陰で支えた社内ツール開発のあれこれ話 / 20250704 Yoshimasa Iwase & Tomoo Morikawa
shift_evolve
PRO
2
1.2k
低レイヤを知りたいPHPerのためのCコンパイラ作成入門 完全版 / Building a C Compiler for PHPers Who Want to Dive into Low-Level Programming - Expanded
tomzoh
4
3.4k
AI専用のリンターを作る #yumemi_patch
bengo4com
5
2.2k
タイミーのデータモデリング事例と今後のチャレンジ
ttccddtoki
6
1.9k
Should Our Project Join the CNCF? (Japanese Recap)
whywaita
PRO
0
300
AWS Organizations 新機能!マルチパーティ承認の紹介
yhana
1
230
事業成長の裏側:エンジニア組織と開発生産性の進化 / 20250703 Rinto Ikenoue
shift_evolve
PRO
2
3.8k
Featured
See All Featured
Mobile First: as difficult as doing things right
swwweet
223
9.7k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
10
940
BBQ
matthewcrist
89
9.7k
Optimising Largest Contentful Paint
csswizardry
37
3.3k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
281
13k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
46
9.6k
The Straight Up "How To Draw Better" Workshop
denniskardys
234
140k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
3.9k
Fashionably flexible responsive web design (full day workshop)
malarkey
407
66k
Stop Working from a Prison Cell
hatefulcrawdad
270
20k
How to Ace a Technical Interview
jacobian
277
23k
The World Runs on Bad Software
bkeepers
PRO
69
11k
Transcript
Mackerel 自身のモニタリング & 監視について 株式会社はてな Web オペレーションエンジニア 大野一樹(id: kizkoh) 2017-11-29
Monitoring Seminar in mercari #mackerelio 1 / 20
自己紹介 大野 一樹 (@kizkoh / id:kizkoh ) 株式会社はてな Web オペレーションエンジニア
最近は Mackerel のインフラを主にひとりで担当 Mackerel の運用しつつ ISUCON7 運営してました 2 / 20
今日おはなしする内容 Mackerel をモニタリング、監視するサービス 信頼性を確保するためにやっていること Mackerel のモニタリング、監視項目の紹介 Mackerel の運用で得たメトリック、監視の知見 3 /
20
Mackerel のモニタリング & 監視 4 / 20
モニタリング & 監視の基本は Mackerel 5 / 20
Mackerel を支える Mackerel ステージング環境と本番環境 Mackerel が動いている環境にはステージング環境と本番環境がある ステージング環境は主に社内利用や API テスト用 ステージング環境のモニタリング
& 監視 本番 Mackerel でモニタリング & 監視 .本番環境のモニタリング & 監視 ステージング Mackerel と本番 Mackerel でモニタリング & 監視 6 / 20
+α: Nagios や外部サービスに依存してる 7 / 20
+α の監視 Nagios の担当箇所 Nagios からの外形監視 (pingdom, Route 53 と一緒)
ステージングも ap-northeast-1 にある Nagios はさくらの VPS にある 移行できていない監視の例 PostgreSQL のレプリケーション遅延監視 Cron の定期実行タスクの終了ステータス監視 8 / 20
Mackerel のモニタリング、監視項目の紹介 9 / 20
ミドルウェアに偏らない、汎用的なお話 10 / 20
Mackerel のモニタリング、監視項目の紹介 Index NLB の監視 Active Standby の監視 Kinesis Streams
のモニタリング ネットワーク系のモニタリング TCP セッションモニタリング トラフィックモニタリング 11 / 20
NLB の監視 Mackerel では NLB を使っている mackerel.io と api.mackerelio.com の前段は
NLB NLB は ICMP に応答しない TCP には背後のインスタンスに到達して応答する なので check-tcp $ ping -c 3 api.mackerelio.com PING api.mackerelio.com (52.198.226.45) 56(84) bytes of data. --- api.mackerelio.com ping statistics --- 3 packets transmitted, 0 received, 100% packet loss, time 2047ms [plugin.checks.tcp] command = "/usr/bin/check-tcp --hostname=api.mackerelio.com --port 443 -t 10 --war notification_interval = 60 max_check_attempts = 2 12 / 20
Active Standby の監視 Keepalived Active Standby を構成している Keepalived プロセスは自動起動しない インスタンスが再起動した際に
keepalived の起動し忘れを防ぐ check-proc プラグインでプロセスの有無を監視している --vrrp オプションを付けているので vrrp_script を入れると 3 つ [plugin.checks.keepalived-procs] command = "/usr/bin/check-procs --pattern='keepalived' --critical-under=2 notification_interval = 600 max_check_attempts = 2 13 / 20
Kinesis Streams のモニタリング 時系列データベースで使っている イメージとしてはジョブキューのようなもの 順序は確保されずランダムに取り出される 取り出しが遅れると溜まっていく 古いものがどんどん Kinesis Streams
に残る 14 / 20
Kinesis Streams のモニタリング 欲しい情報 Kinesis Streams からの読み取りどれくらいの遅延が発生しているか Kinesis Streams シャードの偏りを調べたい
yuuki/mackerel-plugin-aws-kinesis-streams-shard 15 / 20
ネットワーク系 Tcpeek* TCP の 3-way ハンドシェイクモニタリング Syn や Syn/Ack の再送を検知する
/proc/net/snmp の RetransSegs に近いけど細かくした感じ ポートや宛先を絞って通信を追いたいときに便利 クラウド環境だとスイッチでモニタリングできないので便利 pandax381/tcpeek: TCP 3way-handshake monitor DSAS開発者の部屋:ログからは見えてこない高負荷サイトのボトルネック 16 / 20
ネットワーク系 Tcpeek Redis Cluster と Lambda との通信のモニタリング Lambda は再送のモニタリングができない kizkoh/mackerel-plugin-tcpeek:
Mackerel Agent plugin for tcpeek kizkoh/tcpeek_exporter: tcpeek exporter for Prometheus 17 / 20
ネットワーク系 iptables トラフィック管理したい データ転送量がどこで発生しているかをハッキリさせる iptables のチェインの作成で取得できる iptables -N send_redis iptables
-A send_redis -j ACCEPT iptables -N receive_redis iptables -A receive_redis -j ACCEPT iptables -A OUTPUT -p tcp --sport 6379 -j send_redis iptables -A INPUT -p tcp --dport 6379 -j receive_redis Chain receive_redis (1 references) pkts bytes target prot opt in out source destination 0 0 ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0 Chain send_redis (1 references) pkts bytes target prot opt in out source destination 0 0 ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0 18 / 20
ネットワーク系 iptables Chain の統計の差分を計算して Mackerel に送る 式グラフと組み合わせれば AZ 間通信のコスト計算できる kizkoh/mackerel-plugin-nfiptables:
Mackerel Agent plugin for iptables (pkts, bytes) iptables-exporter 0.3.1 : Python Package Index 19 / 20
おわり 20 / 20