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
ソーシャルゲームの長期運用 を目指すための SRE の取り組み - 10 周年を⽬指すコトダマンの場合 -
i2tsuki
5
2.6k
AWS Startup.fm 企業の上場時に必要な監査要件とマネジメントサービスによる解決
i2tsuki
0
110
BuildKit を使った Scala アプリケーションのテストと高速化 @ Docker Meetup Kansai #2
i2tsuki
1
600
20180530LINEDeveloperMeetupRedis-redis-for-mackerelio
i2tsuki
0
470
Mackerel's monitoring and checks
i2tsuki
1
7k
Mackerel インフラ基盤 AWS 移行の舞台裏
i2tsuki
6
10k
Other Decks in Technology
See All in Technology
【5分でわかる】セーフィー エンジニア向け会社紹介
safie_recruit
0
30k
Platform開発が先行する Platform Engineeringの違和感
kintotechdev
3
480
下手な強制、ダメ!絶対! 「ガードレール」を「檻」にさせない"ガバナンス"の取り方とは?
tsukaman
2
370
サンドボックス技術でAI利活用を促進する
koh_naga
0
190
Vault を基盤として整備し、 みんなに使ってもらえるようになるまで
takahiko
1
100
AI時代に非連続な成長を実現するエンジニアリング戦略
sansantech
PRO
3
1.1k
Codeful Serverless / 一人運用でもやり抜く力
_kensh
5
310
生成AI時代のデータ基盤設計〜ペースレイヤリングで実現する高速開発と持続性〜 / Levtech Meetup_Session_2
sansan_randd
1
140
2025年にHCP Vaultを学び直して見えた景色 / Lessons and New Perspectives from Relearning HCP Vault in 2025
aeonpeople
0
210
クラウドセキュリティを支える技術と運用の最前線 / Cutting-edge Technologies and Operations Supporting Cloud Security
yuj1osm
2
290
フルカイテン株式会社 エンジニア向け採用資料
fullkaiten
0
8.7k
BPaaSにおける人と協働する前提のAIエージェント-AWS登壇資料
kentarofujii
0
120
Featured
See All Featured
Building Adaptive Systems
keathley
43
2.7k
How STYLIGHT went responsive
nonsquared
100
5.8k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4k
Practical Orchestrator
shlominoach
190
11k
Keith and Marios Guide to Fast Websites
keithpitt
411
22k
The Art of Programming - Codeland 2020
erikaheidi
55
13k
Faster Mobile Websites
deanohume
309
31k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
248
1.3M
Java REST API Framework Comparison - PWX 2021
mraible
33
8.8k
How GitHub (no longer) Works
holman
315
140k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
15
1.6k
Rebuilding a faster, lazier Slack
samanthasiow
83
9.2k
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!