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
Troubleshooting Node.js
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Igor Soarez
July 23, 2015
Programming
0
260
Troubleshooting Node.js
what to do when things go wrong
Igor Soarez
July 23, 2015
Tweet
Share
Other Decks in Programming
See All in Programming
カスタマーサクセス業務を変革したヘルススコアの実現と学び
_hummer0724
0
620
Oxlint JS plugins
kazupon
1
620
余白を設計しフロントエンド開発を 加速させる
tsukuha
7
2.1k
Lambda のコードストレージ容量に気をつけましょう
tattwan718
0
100
LLM Observabilityによる 対話型音声AIアプリケーションの安定運用
gekko0114
2
420
組織で育むオブザーバビリティ
ryota_hnk
0
170
AIエージェントのキホンから学ぶ「エージェンティックコーディング」実践入門
masahiro_nishimi
3
290
Honoを使ったリモートMCPサーバでAIツールとの連携を加速させる!
tosuri13
1
170
OCaml 5でモダンな並列プログラミングを Enjoyしよう!
haochenx
0
120
Package Management Learnings from Homebrew
mikemcquaid
0
200
MDN Web Docs に日本語翻訳でコントリビュート
ohmori_yusuke
0
640
Vibe Coding - AI 驅動的軟體開發
mickyp100
0
170
Featured
See All Featured
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
19k
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
170
Paper Plane (Part 1)
katiecoart
PRO
0
4k
For a Future-Friendly Web
brad_frost
182
10k
The Pragmatic Product Professional
lauravandoore
37
7.1k
Rebuilding a faster, lazier Slack
samanthasiow
85
9.4k
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
240
It's Worth the Effort
3n
188
29k
Accessibility Awareness
sabderemane
0
49
Build The Right Thing And Hit Your Dates
maggiecrowley
38
3k
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.1k
Transcript
TROUBLESHOOTING NODE.JS what to do when things go wrong Igor
Soarez
[email protected]
@igorsoarez Hassy Veldstra
[email protected]
@hveldstra WDCNZ, July 2015
HELLO HELLO • YLD! • Node.js Consultancy & Training •
Digital transformation for enterprise clients
FIRES Someone has to put them out
BE PREPARED
LOG EVERYTHING Make it easy to grep & visualise
TEST TEST TEST • Functional tests first • Good coverage
for unit tests • Randomised testing & fuzz testing
MONITORING & ALERTING • Resource monitoring • CPU • Memory
• I/O • Application monitoring • Errors • Real-user monitoring • Latency • Availability
AUTOMATED DEPLOYMENTS
PAIR PROGRAMMING
TAKE YOUR TIME WHEN BUILDING YOUR APPLICATION Tight deadlines are
the root of all evil
LOAD TESTING
LOAD TESTING • You should do it
LOAD TESTING • You should do it • Find the
bottlenecks
LOAD TESTING • You should do it • Find the
bottlenecks • Understand your system
LOAD TESTING • You should do it • Find the
bottlenecks • Understand your system
LOAD TESTING
LOAD TESTING
YOU SHOULD DO IT IN PRODUCTION
IN PRODUCTION??? I must have heard you wrong
WHY NOT? Why — Reason 1
STAGING IS NEVER THE SAME Why — Reason 1I
GAIN EXTRA CONFIDENCE Why — Reason 1II
IF YOU DO THIS • Analytics
IF YOU DO THIS • Analytics • Custom header •
Cookie
IF YOU DO THIS • Analytics • Custom header •
Cookie • Let Marketing know
IF YOU DO THIS • Analytics • Custom header •
Cookie • Let Marketing know • Start outside of peak times
IF YOU DO THIS • Analytics • Custom header •
Cookie • Let Marketing know • Start outside of peak times • Start slow & ramp up
LOAD TESTING TOOLS • JMeter
LOAD TESTING TOOLS • JMeter • Tsung
LOAD TESTING TOOLS • JMeter • Tsung • Minigun -
https://artillery.io/minigun
AFTER THE FIRE STARTS how to approach it
PERFORMANCE PROBLEMS
ATTACK THE PROBLEM 1. Isolated test case * 2. Measure
3. Change / Tweak / Improve 4. Goto 2 * If possible
TYPES OF ISSUES • CPU-bound code • Memory leaks •
GC pressure • I/O performance • Event loop lag (Node.js)
KNOW THE TOOLS AVAILABLE • OS-level • perf • sysstat,
netstat, netmon, ps, top • sysdig
KNOW THE TOOLS AVAILABLE • Platform-specific (Node.js)
KNOW THE TOOLS AVAILABLE • Platform-specific (Node.js) • V8 profiler
• find hot-path functions that cannot be optimized • trace GC activity
KNOW THE TOOLS AVAILABLE • Platform-specific (Node.js) • V8 profiler
• find hot-path functions that cannot be optimized • trace GC activity • heapdump • find memory leaks
MEMORY • ps • top / htop • Heapdumps
KNOW THE TOOLS AVAILABLE • Platform-specific (Node.js) • V8 profiler
• find hot-path functions that cannot be optimized • trace GC activity • heapdump • find memory leaks • flamegraphs • see what's hot on the CPU
CPU • ps • top / htop • Flamegraphs
KNOW THE TOOLS AVAILABLE • Platform-specific (Node.js) • V8 profiler
• find hot-path functions that cannot be optimized • trace GC activity • heapdump • find memory leaks • flamegraphs • see what's hot on the CPU • node-toobusy-js • track the event loop lag
FLAMEGRAPHS
PERF aka Performance Counters
Collected stack frames h() c() h() c() c() z() c()
b() f() b() b() f() b() y() b() b() a() a() a() m() a() m() x() m() a() main() main() main() main() main() main() main() main() main()
Collapsed stack frames h() c() h() c() z() b() f()
b() y() a() m() x() main()
DEMO!
THANK YOU! @hveldstra @igorsoarez