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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
i2tsuki
November 29, 2017
Technology
7.4k
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
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
480
6 年の間 SRE がゼロだったプロダクトに Embedded SRE として入って やったこと、感じたこと、これから
i2tsuki
2
160
ソーシャルゲームの長期運用 を目指すための SRE の取り組み - 10 周年を⽬指すコトダマンの場合 -
i2tsuki
5
2.8k
AWS Startup.fm 企業の上場時に必要な監査要件とマネジメントサービスによる解決
i2tsuki
0
140
BuildKit を使った Scala アプリケーションのテストと高速化 @ Docker Meetup Kansai #2
i2tsuki
1
640
20180530LINEDeveloperMeetupRedis-redis-for-mackerelio
i2tsuki
0
500
Mackerel インフラ基盤 AWS 移行の舞台裏
i2tsuki
6
11k
Python Web Application Monitoring in Mackerel
i2tsuki
1
6.3k
Other Decks in Technology
See All in Technology
Oracle AI Database@AWS:サービス概要のご紹介
oracle4engineer
PRO
4
3k
自宅LLMの話
jacopen
1
650
現地で盛り上がった WWDC26 Keynote
zozotech
PRO
1
270
あなたの知らないPDFのアクセシビリティ
lycorptech_jp
PRO
0
220
2026 TECHFRESH 畢業分享會 - 開發日常大解密!從領域驅動到企業級上線
line_developers_tw
PRO
0
1.3k
攻撃者視点で考えるDetection Engineering
cryptopeg
3
2k
白金鉱業Meetup_Vol.24_「AIエージェントは分けるほど良い」は本当か? / Is it true that “the more you divide AI agents, the better”?
brainpadpr
1
410
2026TECHFRESH畢業分享會 - AI 時代的人生存檔點
line_developers_tw
PRO
0
1.3k
AWS Security Agent といっしょに脅威モデリングをやってみよう
amarelo_n24
1
180
徹底討論!ECS vs EKS!
daitak
0
300
入門!AWS Blocks
ysuzuki
1
160
iOS アプリの「これって不具合ですか?」を AI に調べてもらう
miichan
0
100
Featured
See All Featured
The Pragmatic Product Professional
lauravandoore
37
7.3k
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
410
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.5k
Principles of Awesome APIs and How to Build Them.
keavy
128
18k
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
300
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
750
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
230
GraphQLの誤解/rethinking-graphql
sonatard
75
12k
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
200
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
850
Documentation Writing (for coders)
carmenintech
77
5.4k
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