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
6.2k
1
Share
Python Web Application Monitoring in Mackerel
i2tsuki
April 27, 2017
More Decks by i2tsuki
See All by i2tsuki
SRE 視点で事業横断でのオブザーバ ビリティの民主化に取り組んでいる話
i2tsuki
1
420
6 年の間 SRE がゼロだったプロダクトに Embedded SRE として入って やったこと、感じたこと、これから
i2tsuki
2
150
ソーシャルゲームの長期運用 を目指すための SRE の取り組み - 10 周年を⽬指すコトダマンの場合 -
i2tsuki
5
2.8k
AWS Startup.fm 企業の上場時に必要な監査要件とマネジメントサービスによる解決
i2tsuki
0
140
BuildKit を使った Scala アプリケーションのテストと高速化 @ Docker Meetup Kansai #2
i2tsuki
1
630
20180530LINEDeveloperMeetupRedis-redis-for-mackerelio
i2tsuki
0
500
Mackerel's monitoring and checks
i2tsuki
1
7.3k
Mackerel インフラ基盤 AWS 移行の舞台裏
i2tsuki
6
11k
Other Decks in Technology
See All in Technology
[Oracle TechNight#99] 生成AI時代のAI/ML入門 ~ AIとオラクルデータベースの関係 (前半)
oracle4engineer
PRO
1
190
『生成AI時代のクレデンシャルとパーミッション設計 — Claude Code を起点に』の執筆企画
takuros
2
2k
COBOL婆さんの伝説
poropinai1966
0
130
GitHub Copilot CLI と VS Code Agent Mode の使い分け
tomokusaba
0
130
生成AIが変える SaaS の競争原理と弁護士ドットコムのプロダクト戦略
bengo4com
1
3.3k
Chasing Real-Time Observability for CRuby
whitegreen
0
730
AWS Transform CustomでIaCコードを自由自在に変換しよう
duelist2020jp
0
230
[Oracle TechNight#99] 生成AI時代のAI/ML入門 ~ AIとオラクルデータベースの関係 (後半)
oracle4engineer
PRO
2
190
拝啓、あの夏の僕へ〜あなたも知っているApp Runnerの世界〜
news_it_enj
0
190
AIが盛んな時代に 技術記事を書き始めて起きた私の中での小さな変化
peintangos
0
340
EMから幅を広げるために最近挑戦していること / Recent challenges I'm undertaking to expand my horizons beyond EM
hiro_torii
1
180
Angular Architecture Revisited Modernizing Angular Architectural Patterns
rainerhahnekamp
0
120
Featured
See All Featured
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
530
Facilitating Awesome Meetings
lara
57
6.8k
Evolving SEO for Evolving Search Engines
ryanjones
0
180
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4.2k
Building AI with AI
inesmontani
PRO
1
950
Chasing Engaging Ingredients in Design
codingconduct
0
180
Thoughts on Productivity
jonyablonski
76
5.1k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
Designing for Performance
lara
611
70k
GraphQLとの向き合い方2022年版
quramy
50
15k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
52k
Believing is Seeing
oripsolob
1
120
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!