Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Troubleshooting Node.js
Search
Igor Soarez
July 23, 2015
Programming
280
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Troubleshooting Node.js
what to do when things go wrong
Igor Soarez
July 23, 2015
Other Decks in Programming
See All in Programming
Simple Storage Service(S3) is not simple
iwatsukayura
0
290
FactoryBotをやめればRSpecは速くなるのか?
yuta_onishi_97
0
330
re:Inventに行く前に知っておきたい現地参加のノウハウ
nokomoro3
0
430
ソニーのクラウド共通基盤の変遷とAI時代の開発スタイルに合わせた進化 / The Journey of Sony’s Common Cloud Platform and Its Evolution for AI-Native Development
kenjiyoneyama
0
270
dotNET_vulnclicker_intro.pdf
deka_morita
0
140
IBM Bob でAI駆動開発『QC-Playbook』
ichirokano2
0
110
全ての永続トークンを、生まれる前に消し去りたい!
sylph01
2
880
設計次第でAIコードの読む量は減らせる / designing-for-code-reading
minodriven
35
17k
自サークルのIdPからログアウトできるようになるまで
taiseiue
1
140
PumaからFalconに移行したRailsアプリケーションでの実践
falcon8823
0
170
Event is what happens
moro
2
780
AI時代のコードレビューは人に向けるな、仕組みに向けろ
texmeijin
5
3.7k
Featured
See All Featured
Reflections from 52 weeks, 52 projects
jeffersonlam
356
22k
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
2
480
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
1k
For a Future-Friendly Web
brad_frost
184
10k
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
640
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Optimizing for Happiness
mojombo
378
71k
Fantastic passwords and where to find them - at NoRuKo
philnash
53
4k
Java REST API Framework Comparison - PWX 2021
mraible
34
9.8k
Test your architecture with Archunit
thirion
2
2.4k
A Soul's Torment
seathinner
8
3.8k
Unsuck your backbone
ammeep
672
58k
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