Hunting Performance Problems in Node.jsAPAC Tour 2016
Daniel Khan | @dkhan
@dkhan
Daniel [email protected]
Node.js is what the Company Outlaws
use to finally introduce change
Node.js is what the Company Hipsters threw in
just to break everything
Proactive Defense
Node.js is a C++ program controlled by V8 JavaScript
Hunting Memory Problems
process.memoryUsage(){ rss: 4935680, heapTotal: 1826816, heapUsed: 650472 }
theThing
someMethod()
longStr
unused()
originalThing
Closure Context
Reference
Root
http://bit.ly/1PvijIy
var snap = profiler.takeSnapshot();snap.serialize();
v8-profiler
Delta
Hunting CPUProblems
calculateFibonacci();
http://bit.ly/1jQMbBR
profiler.startProfiling(id); profiler.stopProfiling(id);
v8-profiler
NODE_ENV=productionNODE_ENV=development
Blog: http://bit.ly/1flz0Xm
Border Defense
1980 20001995 2005 2010 2015
Stakeholders
“No man is an island”or … We need a holistic view.
Browser Webserver Node Java Oracle
Meet Application Performance Monitoring
Node.js
Transactional Tracing and Node.js
Takeaways• Node.js introduces change• If something breaks within Node.js it’s most probably a memory leak or a CPU hog• Protect your boundaries by actively monitoring incoming and outgoing transactions• Use APM Solutions like Dynatrace or Ruxit to get a holistic view for all transactions passing
through all tiers of your stack• There is more to come when Node.js’ tracing capabilities mature
@dkhan
Top Related