Node.js Getting started with Nodes profiling

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

Introduction

The aim of this post is to get started with profiling nodejs application and how to make sense of this results to capture a bug or a memory leak. A nodejs running application is nothing but a v8 engine processes which is in many terms similar to a website running on a browser and we can basically capture all the metrics which are related to a website process for a node application.

The tool of my preference is chrome devtools or chrome inspector coupled with the node-inspector.

Remarks

The node-inspector fails to attach to the node bebug process sometimes in which case you will not be able to get the debug breakpoint in devtools .Try refreshing the devtools tab multiple times and wait for some seconds to see if it is in debug mode.

If not restart the node-inspector from command line.



Got any Node.js Question?