hunting performance problems in node.js

Post on 18-Feb-2017

3.119 Views

Category:

Software

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

@dkhan

My Startup

The moment that you find out about a problem …

What is Node.js?

Node.js is a C++ program controlled by V8 JavaScript

Your Code

Node Standard Library

Node Bindings

V8 Thread Pool Event Loop

JavaScript

C++

process.memoryUsage(){ rss: 4935680, heapTotal: 1826816, heapUsed: 650472 }

char * buffer;buffer = (char*) malloc (42);

// Do something with buffer

free (buffer);

Allocate

Deallocate

Scavenge Compact

Mark Sweep

node-gc-profiler

http://bit.ly/1Ll6dhb

This is where I’ll spend my weekend

http://bit.ly/1PvijIy

var snap = profiler.takeSnapshot();snap.serialize();

v8-profiler

theThing = null;

Delta

calculateFibonacci();

http://bit.ly/1jQMbBR

profiler.startProfiling(id); profiler.stopProfiling(id);

v8-profiler

NODE_ENV=productionNODE_ENV=development

Blog: http://bit.ly/1flz0Xm

Let’s put this all together

Process v8-profiler

Memory Usage Heap Dumps

CPU Dumps

Chrome Developer Tools

Your Monitoring Dashboard

Trigger

• ab –c 5 –n 10000 https://yoursite.com• JMeter• Keynote• http://bit.ly/1NkX1Ku

Do load testing!

Slides? Blog!? Tweets?!!1

Daniel Khan

@dkhan

http://apmblog.dynatrace.com/author/daniel-khan/

Thank you!

top related