5

I need to debug 100% cpu usage of my nodejs process. I found node --prof myapp.js is very helpful. Now I have another application that will fork child process and I need to debug that child process. here is how I was forking the process.

require('child_process').fork("childfile.js", ["arg1","arg2], {silent: true});

Now my question is that, is it possible to profile child process, then how can I pass "--prof" option.

kamesh
  • 391
  • 2
  • 3
  • 11
  • 1
    check this link https://stackoverflow.com/questions/16840623/how-to-debug-node-js-child-forked-process possibly a duplicate of this – Shashank Jul 05 '17 at 10:27

1 Answers1

2
require('child_process').fork("childfile.js", ["arg1","arg2], {silent: true,execArgv:["--prof"]});