Profiling Node.js Using DTrace

I am currently profiling my node.js application. I found this blog: http://blog.nodejs.org/2012/04/25/profiling-node-js/ , which suggests that I should use Dtrace. I installed dtrace on ubuntu 12.04 using the steps given here: https://askubuntu.com/questions/60940/how-do-i-install-dtrace

However, when I run this command in my terminal when the node application is running:

dtrace -o stacks.out -n 'profile-97/execname == "node" && arg1/{ @[jstack(100, 8000)] = count(); } tick-60s { exit(0); }' 

stacks.out stays empty except for this: CPU ID FUNCTION: NAME 1 387695: tick-60s

Any suggestions what could be wrong?

+6
source share
3 answers

Linux DTrace implementations are currently very young and lack some important features (and are by no means ready for use in production). In particular, the DTrace implementation you use (Paul Fox's) has not done much if there is any work to support user space tracking. Therefore, you cannot do this under Linux (right now).

If you want this to work, you will need to use an operating system with a more complete implementation of DTrace. It is best to use one of Illumos derivatives (such as OmniOS , SmartOS or OpenIndiana ).

You must re-read the Prerequisites section of the article that you linked to . It says that you also need to make sure that you are using 32-bit NodeJS with DTrace support at compile time.

(Mac OS X has a good DTrace implementation, but according to the article , it does not support the ustack helpers, which are necessary for this example.)

+7
source

@psanford has a good answer specifically related to your problems with DTrace, but from your introductory sentence, it looks like you want to track your Node.js application, and DTrace is just one example of how to do this.

In this case, the combination of node-inspector and v8-profiler will provide you with the necessary introspection into your application. I am not sure if it works with Node 0.6.x, however, since the last time I used it from 0.4.10.

+3
source

Oracle announced DTrace Availability in Oracle Linux . You can download this distribution here .

+1
source

Source: https://habr.com/ru/post/919019/


All Articles