Lock in $30 Savings on PRO—Offer Ends Soon! ⏳
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
HOW DO YOU KNOW iT'S WORKiNG
Search
Mike Fiedler
May 20, 2016
Technology
0
110
HOW DO YOU KNOW iT'S WORKiNG
Monitoring NGiNX.Presented during
https://ngenious.website/
Mike Fiedler
May 20, 2016
Tweet
Share
More Decks by Mike Fiedler
See All by Mike Fiedler
Fixing AWS with AWS
miketheman
1
130
Instrumenting Application Stack in Dynamically Scaling Environment
miketheman
0
66
Giving (and Taking) Back
miketheman
0
58
Where Do We Go From Here?
miketheman
0
150
What's In This Cookbook?
miketheman
0
56
Treating Your Infrastructure Like Garbage
miketheman
2
1.7k
MongoDB - Operations Best Practices
miketheman
1
120
MongoDB in the Cloud - Amazon Web Services
miketheman
3
120
Other Decks in Technology
See All in Technology
Amazon Bedrock Knowledge Bases × メタデータ活用で実現する検証可能な RAG 設計
tomoaki25
6
2k
AgentCore BrowserとClaude Codeスキルを活用した 『初手AI』を実現する業務自動化AIエージェント基盤
ruzia
7
860
mairuでつくるクレデンシャルレス開発環境 / Credential-less development environment using Mailru
mirakui
5
580
Snowflake導入から1年、LayerXのデータ活用の現在 / One Year into Snowflake: How LayerX Uses Data Today
civitaspo
0
1.9k
通勤手当申請チェックエージェント開発のリアル
whisaiyo
3
340
AI時代のワークフロー設計〜Durable Functions / Step Functions / Strands Agents を添えて〜
yakumo
3
1.8k
AWS運用を効率化する!AWS Organizationsを軸にした一元管理の実践/nikkei-tech-talk-202512
nikkei_engineer_recruiting
0
160
AI との良い付き合い方を僕らは誰も知らない
asei
0
220
子育てで想像してなかった「見えないダメージ」 / Unforeseen "hidden burdens" of raising children.
pauli
2
310
Lookerで実現するセキュアな外部データ提供
zozotech
PRO
0
190
ペアーズにおけるAIエージェント 基盤とText to SQLツールの紹介
hisamouna
2
1.3k
プロンプトやエージェントを自動的に作る方法
shibuiwilliam
15
16k
Featured
See All Featured
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.3k
Darren the Foodie - Storyboard
khoart
PRO
0
1.9k
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
0
180
Utilizing Notion as your number one productivity tool
mfonobong
2
180
Leo the Paperboy
mayatellez
0
1.2k
How to Ace a Technical Interview
jacobian
281
24k
Information Architects: The Missing Link in Design Systems
soysaucechin
0
710
Statistics for Hackers
jakevdp
799
230k
Six Lessons from altMBA
skipperchong
29
4.1k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
61k
How to Think Like a Performance Engineer
csswizardry
28
2.4k
Reality Check: Gamification 10 Years Later
codingconduct
0
1.9k
Transcript
HOW DO YOU KNOW iT’S WORKiNG MONiTORiNG
MiKE FiEDLER Wrangler of the Unusual Twitter: @mikefiedler Github: @miketheman
OpsSchool.org Chef Community Roller Derby Referee © Alex Erde
WHO CARES?
DOES iT EVEN?
DOES iT EVEN? YES iT DOES!
ACTiViTiES - ngx_http_stub_status_module $ nginx -V 2>&1 | grep -o
with-http_stub_status_module with-http_stub_status_module location /basic_status { stub_status; } $ curl http://localhost/basic_status Active connections: 1 server accepts handled requests 8 8 18 Reading: 0 Writing: 1 Waiting: 0
location /basic_status { allow 127.0.0.1; deny all; stub_status on; access_log
off; } Active connections: 45 server accepts handled requests 1023122 1023122 4270474 Reading: 0 Writing: 1 Waiting: 44 ACTiViTiES - SECURE-ER
MOAR??! - ngx_http_status_module
None
FREE AS A BiRD: ❖ awstats ❖ goaccess ❖ syslog/fluentd/logstash
❖ elasticsearch (ELK/EFK) LOGS - SO MUCH DATA DOLLA DOLLA BiLLS: ❖ Logentries ❖ Loggly ❖ Logz.io ❖ Splunk
• Emit log line • Log line is written to
file descriptor • Line is then: ◦ Read ◦ Shipped ◦ Tokenized ◦ Parsed ◦ Stored ◦ Eventually trashed • Oh, wait, the log line format changed?? FFS!! LOG PARSING iS HARD, MiKE!
STATSD (spec) • Push-based • UDP, connectionless • Lightweight datagram
<metric name>:<value>|c[|@<sample rate>] nginx.requests:1|c EMiTTERS TO THE RESCUE!
GET ME AN EMiTTER! Lua-based: • https://github.com/musicglue/ngx_lua_statsd • https://github.com/simplifi/ngx_lua_datadog •
https://github.com/lonelyplanet/openresty-statsd • https://github.com/knyar/nginx-lua-prometheus Native C: https://github.com/zebrafishlabs/nginx-statsd
DiD SOMEONE SAY C? HMMM…. • Get nginx source code
• Get emitter module • Patch a couple of files • Build a package • Config & run server { ... statsd_server localhost; statsd_count "nginx.requests" 1; statsd_count "nginx.responses.$status" 1 "$status"; statsd_count "nginx.request_length" "$request_length"; statsd_count "nginx.bytes_sent" "$bytes_sent"; location / { ...
PROFiT!
INSTRUMENT all resources • CPU • Network I/O • Disk
I/O & space (!!!) SUMMARY - MONiTOR FiRST ALERT on activities • Page loads • Dropped connections • Requests per second • Request timings • Error rates ESTABLiSH BASELiNES PRiOR TO CHANGE!
THANKS! https://github.com/miketheman/ngenious-statsd QUESTiONS?