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
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
アルテニア コンサル/ITエンジニア向け 採用ピッチ資料
altenir
0
110
為你自己學 Python - 冷知識篇
eddie
1
350
[FEConf 2025] 모노레포 절망편, 14개 레포로 부활하기까지 걸린 1년
mmmaxkim
0
1.6k
Azure SRE Agentで運用は楽になるのか?
kkamegawa
0
2.3k
FindyにおけるTakumi活用と脆弱性管理のこれから
rvirus0817
0
510
基礎から学ぶ大画面対応(Learning Large-Screen Support from the Ground Up)
tomoya0x00
0
1.5k
Putting The Genie in the Bottle - A Crash Course on running LLMs on Android
iurysza
0
140
私の後悔をAWS DMSで解決した話
hiramax
4
210
請來的 AI Agent 同事們在寫程式時,怎麼用 pytest 去除各種幻想與盲點
keitheis
0
120
今から始めるClaude Code入門〜AIコーディングエージェントの歴史と導入〜
nokomoro3
0
180
go test -json そして testing.T.Attr / Kyoto.go #63
utgwkk
3
310
MCPとデザインシステムに立脚したデザインと実装の融合
yukukotani
4
1.4k
Featured
See All Featured
Reflections from 52 weeks, 52 projects
jeffersonlam
352
21k
Six Lessons from altMBA
skipperchong
28
4k
Unsuck your backbone
ammeep
671
58k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
8
920
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
1.6k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
Intergalactic Javascript Robots from Outer Space
tanoku
272
27k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
53
2.9k
Imperfection Machines: The Place of Print at Facebook
scottboms
268
13k
Building an army of robots
kneath
306
46k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Designing for humans not robots
tammielis
253
25k
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