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
7.3k
1
Share
Mackerel's monitoring and checks
Monitoring Seminar in mercari で Mackerel 自身のモニタリング & 監視についてお話しました。
i2tsuki
November 29, 2017
More Decks by i2tsuki
See All by i2tsuki
SRE 視点で事業横断でのオブザーバ ビリティの民主化に取り組んでいる話
i2tsuki
1
420
6 年の間 SRE がゼロだったプロダクトに Embedded SRE として入って やったこと、感じたこと、これから
i2tsuki
2
150
ソーシャルゲームの長期運用 を目指すための SRE の取り組み - 10 周年を⽬指すコトダマンの場合 -
i2tsuki
5
2.8k
AWS Startup.fm 企業の上場時に必要な監査要件とマネジメントサービスによる解決
i2tsuki
0
140
BuildKit を使った Scala アプリケーションのテストと高速化 @ Docker Meetup Kansai #2
i2tsuki
1
630
20180530LINEDeveloperMeetupRedis-redis-for-mackerelio
i2tsuki
0
500
Mackerel インフラ基盤 AWS 移行の舞台裏
i2tsuki
6
11k
Python Web Application Monitoring in Mackerel
i2tsuki
1
6.2k
Other Decks in Technology
See All in Technology
Oracle Exadata Database Service on Cloud@Customer X11M (ExaDB-C@C) サービス概要
oracle4engineer
PRO
2
7.9k
Building Production-Ready Agents Microsoft Agent Framework
_mertmetin
0
140
Forget technical debt
ufried
0
150
VespaのParent Childを用いたフィードパフォーマンスの改善
taking
0
180
UIライブラリに依存しすぎないReact Native設計を目指して
grandbig
0
190
Agents CLI と Gemini Enterprise Agent Platform で マルチエージェント開発が楽しくなる!
kaz1437
0
220
データ定義の混乱と戦う 〜 管理会計と財務会計 〜
wonohe
0
170
AWS Transform CustomでIaCコードを自由自在に変換しよう
duelist2020jp
0
230
Angular Architecture Revisited Modernizing Angular Architectural Patterns
rainerhahnekamp
0
120
ファインディの事業拡大を支える 拡張可能なデータ基盤へのリアーキテクチャ
hiracky16
0
780
FessのAI検索モード:検索システムとLLMへの取り組み
marevol
0
170
試作とデモンストレーション / Prototyping and Demonstrations
ks91
PRO
0
160
Featured
See All Featured
Chasing Engaging Ingredients in Design
codingconduct
0
180
Evolving SEO for Evolving Search Engines
ryanjones
0
180
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
49
9.9k
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
530
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
1.9k
Optimizing for Happiness
mojombo
378
71k
Utilizing Notion as your number one productivity tool
mfonobong
4
300
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
230
Optimising Largest Contentful Paint
csswizardry
37
3.7k
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
760
Agile that works and the tools we love
rasmusluckow
331
21k
Fashionably flexible responsive web design (full day workshop)
malarkey
408
66k
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