how to set worker v8 options in cluster module?

101 views
Skip to first unread message

darcy

unread,
Aug 9, 2012, 2:44:17 AM8/9/12
to nod...@googlegroups.com
if start program by "node --trace_gc mynode.js",, and use cluster module to start worker process, the options is not passed to the worker. 

I learned the api docs, but no api for this popurse.

Ben Noordhuis

unread,
Aug 9, 2012, 10:59:54 AM8/9/12
to nod...@googlegroups.com
Try this:

var argv = process.execArgv.concat(['--trace_gc']);
child_process.fork(filename, {execArgv:argv});

darcy

unread,
Aug 10, 2012, 2:13:14 AM8/10/12
to nod...@googlegroups.com
Thanks for your help.
I've found that process.execArgv is supported in v0.8, but not in v0.6, which is used by me now.
And in cluster of node v0.8, the worker process is started with the node options used in master default.
Reply all
Reply to author
Forward
0 new messages