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
6k
Python Web Application Monitoring in Mackerel
i2tsuki
April 27, 2017
Tweet
Share
More Decks by i2tsuki
See All by i2tsuki
6 年の間 SRE がゼロだったプロダクトに Embedded SRE として入って やったこと、感じたこと、これから
i2tsuki
2
110
ソーシャルゲームの長期運用 を目指すための SRE の取り組み - 10 周年を⽬指すコトダマンの場合 -
i2tsuki
5
2.7k
AWS Startup.fm 企業の上場時に必要な監査要件とマネジメントサービスによる解決
i2tsuki
0
120
BuildKit を使った Scala アプリケーションのテストと高速化 @ Docker Meetup Kansai #2
i2tsuki
1
600
20180530LINEDeveloperMeetupRedis-redis-for-mackerelio
i2tsuki
0
480
Mackerel's monitoring and checks
i2tsuki
1
7.1k
Mackerel インフラ基盤 AWS 移行の舞台裏
i2tsuki
6
10k
Other Decks in Technology
See All in Technology
ブラウザのAPIで Nintendo Switch用の特殊なゲーム用コントローラーを体験型コンテンツに / IoTLT @ストラタシス・ジャパン
you
PRO
0
130
Azureコストと向き合った、4年半のリアル / Four and a half years of dealing with Azure costs
aeonpeople
1
290
CNCFの視点で捉えるPlatform Engineering - 最新動向と展望 / Platform Engineering from the CNCF Perspective
hhiroshell
0
140
Implementing and Evaluating a High-Level Language with WasmGC and the Wasm Component Model: Scala’s Case
tanishiking
0
180
Dylib Hijacking on macOS: Dead or Alive?
patrickwardle
0
470
ローカルLLMとLINE Botの組み合わせ その2(EVO-X2でgpt-oss-120bを利用) / LINE DC Generative AI Meetup #7
you
PRO
1
160
生成AI時代のPythonセキュリティとガバナンス
abenben
0
140
現場の壁を乗り越えて、 「計装注入」が拓く オブザーバビリティ / Beyond the Field Barriers: Instrumentation Injection and the Future of Observability
aoto
PRO
1
540
ハノーファーメッセ2025で見た生成AI活用ユースケース.pdf
hamadakoji
1
460
クラウドとリアルの融合により、製造業はどう変わるのか?〜クラスメソッドの製造業への取組と共に〜
hamadakoji
0
420
Behind Postgres 18: The People, the Code, & the Invisible Work | Claire Giordano | PGConfEU 2025
clairegiordano
0
130
Building a cloud native business on open source
lizrice
0
180
Featured
See All Featured
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
658
61k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
3.7k
Designing for humans not robots
tammielis
254
26k
[RailsConf 2023] Rails as a piece of cake
palkan
57
5.9k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.5k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
31
2.7k
Bash Introduction
62gerente
615
210k
We Have a Design System, Now What?
morganepeng
53
7.8k
Designing for Performance
lara
610
69k
Art, The Web, and Tiny UX
lynnandtonic
303
21k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.5k
Building Flexible Design Systems
yeseniaperezcruz
329
39k
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!