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
7.2k
Mackerel's monitoring and checks
Monitoring Seminar in mercari で Mackerel 自身のモニタリング & 監視についてお話しました。
i2tsuki
November 29, 2017
Tweet
Share
More Decks by i2tsuki
See All by i2tsuki
6 年の間 SRE がゼロだったプロダクトに Embedded SRE として入って やったこと、感じたこと、これから
i2tsuki
2
120
ソーシャルゲームの長期運用 を目指すための SRE の取り組み - 10 周年を⽬指すコトダマンの場合 -
i2tsuki
5
2.7k
AWS Startup.fm 企業の上場時に必要な監査要件とマネジメントサービスによる解決
i2tsuki
0
130
BuildKit を使った Scala アプリケーションのテストと高速化 @ Docker Meetup Kansai #2
i2tsuki
1
610
20180530LINEDeveloperMeetupRedis-redis-for-mackerelio
i2tsuki
0
480
Mackerel インフラ基盤 AWS 移行の舞台裏
i2tsuki
6
10k
Python Web Application Monitoring in Mackerel
i2tsuki
1
6.1k
Other Decks in Technology
See All in Technology
AWSに革命を起こすかもしれない新サービス・アップデートについてのお話
yama3133
0
520
Introduce marp-ai-slide-generator
itarutomy
0
150
AI駆動開発ライフサイクル(AI-DLC)の始め方
ryansbcho79
0
240
Everything As Code
yosuke_ai
0
120
[Data & AI Summit '25 Fall] AIでデータ活用を進化させる!Google Cloudで作るデータ活用の未来
kirimaru
0
4.1k
Agent Skillsがハーネスの垣根を超える日
gotalab555
6
4.7k
Authlete で実装する MCP OAuth 認可サーバー #CIMD の実装を添えて
watahani
0
260
SES向け、生成AI時代におけるエンジニアリングとセキュリティ
longbowxxx
0
170
202512_AIoT.pdf
iotcomjpadmin
0
160
Autonomous Database - Dedicated 技術詳細 / adb-d_technical_detail_jp
oracle4engineer
PRO
5
11k
Keynoteから見るAWSの頭の中
nrinetcom
PRO
1
110
Snowflake導入から1年、LayerXのデータ活用の現在 / One Year into Snowflake: How LayerX Uses Data Today
civitaspo
0
2.6k
Featured
See All Featured
The Spectacular Lies of Maps
axbom
PRO
1
400
Everyday Curiosity
cassininazir
0
110
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
7.9k
It's Worth the Effort
3n
187
29k
How To Stay Up To Date on Web Technology
chriscoyier
791
250k
Ten Tips & Tricks for a 🌱 transition
stuffmc
0
37
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
1.8k
Believing is Seeing
oripsolob
0
17
The Limits of Empathy - UXLibs8
cassininazir
1
200
Game over? The fight for quality and originality in the time of robots
wayneb77
1
67
What’s in a name? Adding method to the madness
productmarketing
PRO
24
3.8k
What's in a price? How to price your products and services
michaelherold
246
13k
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