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
HOW DO YOU KNOW iT'S WORKiNG
Search
Mike Fiedler
May 20, 2016
Technology
120
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
HOW DO YOU KNOW iT'S WORKiNG
Monitoring NGiNX.Presented during
https://ngenious.website/
Mike Fiedler
May 20, 2016
More Decks by Mike Fiedler
See All by Mike Fiedler
Fixing AWS with AWS
miketheman
1
140
Instrumenting Application Stack in Dynamically Scaling Environment
miketheman
0
73
Giving (and Taking) Back
miketheman
0
67
Where Do We Go From Here?
miketheman
0
170
What's In This Cookbook?
miketheman
0
60
Treating Your Infrastructure Like Garbage
miketheman
2
1.7k
MongoDB - Operations Best Practices
miketheman
1
130
MongoDB in the Cloud - Amazon Web Services
miketheman
3
130
Other Decks in Technology
See All in Technology
35分でわかるEffective Platform Engineering
nwiizo
5
400
ソフトウェアサプライチェーンの構造的リスクとコンテナ環境の保護
kyohmizu
4
610
Sansan Engineering Unit 紹介資料
sansan33
PRO
1
5k
カートの信頼性を担保するWireMockを使ったe2eテスト
ykagano
0
520
Digitization部 紹介資料
sansan33
PRO
2
7.7k
Genie Codeハンズオン応用編
taka_aki
0
120
Contract One Engineering Unit 紹介資料
sansan33
PRO
0
19k
まちスペース®とデジタルツインと「まちづくり」
hiro_ogi
0
130
Data Hubグループ 紹介資料
sansan33
PRO
0
3.2k
猫付きpingコマンドを自作
uyuki234
0
260
AWS ネットワーク構築でハマった(ハマりかけた) 5選とそこから得た教訓
nagisa53
4
270
事業価値と Engineering 2026年度版
recruitengineers
PRO
51
25k
Featured
See All Featured
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
KATA
mclloyd
PRO
35
15k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
6k
4 Signs Your Business is Dying
shpigford
187
23k
Highjacked: Video Game Concept Design
rkendrick25
PRO
1
440
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
340
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
2
1.6k
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.5k
Abbi's Birthday
coloredviolet
3
9.4k
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
250
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
210
Rebuilding a faster, lazier Slack
samanthasiow
85
9.6k
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?