Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Welcome to Mordor - Daniel Kahn - Codemotion Amsterdam 2016


Published on

If there is bad press about Node.js it's because of performance issues and how hard it is to track them down. Usually these problems are hiding during development but start to kick in under high load. Not good. In my talk we will briefly go through the "hall of fame" of Node.js performance problems and the technical details behind them. By doing so, we will also get some valuable insights on how Node.js (V8, libuv) works internally. Then we will learn how to create metrics that the V8 engine provides to us out of the box and learn about tools that help interpreting them.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Welcome to Mordor - Daniel Kahn - Codemotion Amsterdam 2016

  1. 1. Hunting Performance Problems in Node.js CodeMotion Amsterdam 2016 Daniel Khan | @dkhan
  2. 2. Node.js is what the Company Outlaws use to finally introduce change
  3. 3. Node.js is what the Company Hipsters threw in just to break everything
  4. 4. Proactive Defense
  5. 5. Node.js is a C++ program controlled by V8 JavaScript
  6. 6. Hunting Memory Problems
  7. 7. process.memoryUsage() { rss: 4935680, heapTotal: 1826816, heapUsed: 650472 }
  8. 8. How to build a Memory Leak
  9. 9. theThing someMethod() longStr unused() originalThing Closure Context Reference Root
  10. 10. var snap = profiler.takeSnapshot(); snap.serialize(); v8-profiler
  11. 11. D e l t a
  12. 12. Hunting CPU Problems
  13. 13. calculateFibonacci();
  14. 14. profiler.startProfiling(id); profiler.stopProfiling(id); v8-profiler
  15. 15. NODE_ENV=productionNODE_ENV=development Blog:
  16. 16. get(‘/routeA’, function(){}) get(‘/routeB’, function(){}) get(‘/routeC’, function(){}) get(‘/routeD’, function(){}) get(‘/routeE’, function(){}) get(‘/routeA’, function(){}) get(‘/routeX’, function(){}) get(‘/^(route|router)/(.+)’, function(){}) HTTP GET /routeX get(‘/routeA’, function(){}) get(‘/routeX’, function(){}) O(n)
  17. 17. Finding the route
  18. 18. 1980 20001995 2005 2010 2015 Stakeholders
  19. 19. “No man is an island” or … We need a holistic view.
  20. 20. Meet Application Performance Monitoring
  21. 21. Takeaways • Node.js introduces change • Use dedicated tools like N|Solid to monitor Node.js specific metrics like CPU and Memory Usage • 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
  22. 22. @dkhan Daniel Khan Node.js Technology Lead