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
Python Web Application Monitoring in Mackerel
Search
i2tsuki
April 27, 2017
Technology
1
5.8k
Python Web Application Monitoring in Mackerel
i2tsuki
April 27, 2017
Tweet
Share
More Decks by i2tsuki
See All by i2tsuki
ソーシャルゲームの長期運用 を目指すための SRE の取り組み - 10 周年を⽬指すコトダマンの場合 -
i2tsuki
5
2.4k
AWS Startup.fm 企業の上場時に必要な監査要件とマネジメントサービスによる解決
i2tsuki
0
89
BuildKit を使った Scala アプリケーションのテストと高速化 @ Docker Meetup Kansai #2
i2tsuki
1
570
20180530LINEDeveloperMeetupRedis-redis-for-mackerelio
i2tsuki
0
460
Mackerel's monitoring and checks
i2tsuki
1
6.8k
Mackerel インフラ基盤 AWS 移行の舞台裏
i2tsuki
6
10k
Other Decks in Technology
See All in Technology
ホワイトボードチャレンジ 説明&実行資料
ichimichi
0
130
Helm , Kustomize に代わる !? 次世代 k8s パッケージマネージャー Glasskube 入門 / glasskube-entry
parupappa2929
0
250
データ資産をシームレスに伝達するためのイベント駆動型アーキテクチャ
kakehashi
PRO
2
570
2025-02-21 ゆるSRE勉強会 Enhancing SRE Using AI
yoshiiryo1
1
390
PHPカンファレンス名古屋-テックリードの経験から学んだ設計の教訓
hayatokudou
2
450
深層学習と古典的画像アルゴリズムを組み合わせた類似画像検索内製化
shutotakahashi
0
130
目の前の仕事と向き合うことで成長できる - 仕事とスキルを広げる / Every little bit counts
soudai
26
7.4k
全文検索+セマンティックランカー+LLMの自然文検索サ−ビスで得られた知見
segavvy
2
120
Oracle Cloud Infrastructure:2025年2月度サービス・アップデート
oracle4engineer
PRO
1
240
『衛星データ利用の方々にとって近いようで触れる機会のなさそうな小話 ~ 衛星搭載ソフトウェアと衛星運用ソフトウェア (実物) を動かしながらわいわいする編 ~』 @日本衛星データコミニティ勉強会
meltingrabbit
0
150
利用終了したドメイン名の最強終活〜観測環境を育てて、分析・供養している件〜 / The Ultimate End-of-Life Preparation for Discontinued Domain Names
nttcom
2
240
人はなぜISUCONに夢中になるのか
kakehashi
PRO
6
1.7k
Featured
See All Featured
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
40
2k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
4
350
The Language of Interfaces
destraynor
156
24k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
30
4.6k
For a Future-Friendly Web
brad_frost
176
9.5k
Agile that works and the tools we love
rasmusluckow
328
21k
jQuery: Nuts, Bolts and Bling
dougneiner
63
7.6k
Docker and Python
trallard
44
3.3k
How GitHub (no longer) Works
holman
314
140k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
Practical Orchestrator
shlominoach
186
10k
Transcript
Python Web Application Monitoring in Mackerel id:kizkoh Hatena Co., Ltd.
2017-04-27 Mackerel Meetup #10 Tokyo #mackerelio
Python Web Application Application - WSGI に則ったインターフェイスを持つ
Python Web Application WSGI WSGI は Python の Web アプリケーション規格
uWSGI 高機能な WSGI 対応 Web サーバ Python(WSGI) 以外にも対応 Ruby Perl
(PSGI) PHP Java Lua
uWSGI --stats オプション[1] JSON 形式でメトリクスの出力をサポート 出力されるメトリクス Backlog (処理待ちリクエスト)、worker 数、処理リクエスト数に対応 Busy
Worker, Idle Worker 累計処理リクエスト数 mackerel-plugin-uwsgi-vassal でサポート [1] "The uWSGI Stats Server — uWSGI 2.0 documentation" http://uwsgi- docs.readthedocs.io/en/latest/StatsServer.html
uWSGI Workers
uWSGI Requests
uWSGI Listen Queue
Gunicorn シンプルな WSGI 対応 Web サーバ uWSGI と違い Python(WSGI) のみ対応
--statsd_host オプション[1] Worker の状態(busy, idle) を区別できない [1] "Settings — Gunicorn 19.7.1 documentation"" http://docs.gunicorn.org/en/stable/settings.html#statsd-host
モニタリングのために WSGI ミドルウェア作った!
WSGI Status[1] アプリケーション(WAF)の前段に置く 通過するときにメトリクスを出力する uwsgi の stats と同じフォーマットでファイルに出力 [1] "wsgi_status
0.2.5 : Python Package Index" https://pypi.python.org/pypi/wsgi_status/
Gunicorn Workers
Gunicorn Requests
Python Web Application Monitoring uWSGI 細かなメトリクスを収集できる 設定に慣れが必要、運用が難しい Gunicorn WSGI status
をミドルウェアとして挟む 設定項目が少ない、運用が簡単 uWSGI, Gunicorn 両方とも Mackerel でモニタリングできる!!
mackerel-plugin-uwsgi-vassal
Enjoy Python Hack!