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
6.1k
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
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's monitoring and checks
i2tsuki
1
7.2k
Mackerel インフラ基盤 AWS 移行の舞台裏
i2tsuki
6
10k
Other Decks in Technology
See All in Technology
松尾研LLM講座2025 応用編Day3「軽量化」 講義資料
aratako
12
4.6k
株式会社ビザスク_AI__Engineering_Summit_Tokyo_2025_登壇資料.pdf
eikohashiba
1
130
Oracle Database@AWS:サービス概要のご紹介
oracle4engineer
PRO
2
460
TED_modeki_共創ラボ_20251203.pdf
iotcomjpadmin
0
170
AWS re:Invent 2025~初参加の成果と学び~
kubomasataka
1
200
意外と知らない状態遷移テストの世界
nihonbuson
PRO
1
320
Knowledge Work の AI Backend
kworkdev
PRO
0
320
AIBuildersDay_track_A_iidaxs
iidaxs
4
1.5k
Redshift認可、アップデートでどう変わった?
handy
1
110
Entity Framework Core におけるIN句クエリ最適化について
htkym
0
130
Bedrock AgentCore Evaluationsで学ぶLLM as a judge入門
shichijoyuhi
2
290
フルカイテン株式会社 エンジニア向け採用資料
fullkaiten
0
9.9k
Featured
See All Featured
Writing Fast Ruby
sferik
630
62k
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
54
48k
It's Worth the Effort
3n
187
29k
Bash Introduction
62gerente
615
210k
Bootstrapping a Software Product
garrettdimon
PRO
307
120k
Site-Speed That Sticks
csswizardry
13
1k
Highjacked: Video Game Concept Design
rkendrick25
PRO
0
260
Designing for humans not robots
tammielis
254
26k
sira's awesome portfolio website redesign presentation
elsirapls
0
94
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
32
Getting science done with accelerated Python computing platforms
jacobtomlinson
0
82
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
78
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!