Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

passing v8 options to workers #139

Open
gitfy opened this issue Aug 9, 2011 · 5 comments
Open

passing v8 options to workers #139

gitfy opened this issue Aug 9, 2011 · 5 comments

Comments

@gitfy
Copy link

gitfy commented Aug 9, 2011

Hi,
How do i pass the v8 options to the cluster workers. I need to pass --max-old-space-size=1900 to all my workers, but somehow looks like the option is not passed and the node process dies when it eventually reaches the max mem of 1gb.

Thanks.

@tj
Copy link
Contributor

tj commented Aug 10, 2011

hmm they should be passing fine:

  this.proc = spawn(
      node
    , this.master.cmd
    , { customFds: customFds, env: env });

where for example this.master.cmd in my case was [ '/Users/tj/projects/cluster/examples/basic', '--crankshaft' ]

passing along the args just fine

@gitfy
Copy link
Author

gitfy commented Aug 10, 2011

The issues is :
node options or v8 options should be passed like

node [options] script.js [app-options]

The spawn parameter this.master.cmd should have the node/v8-options as the first entry rather than second in the list. Only then it will work.

Here is an example of the process list from my machine :

501 10261 10257 4006 0 33 0 4741568 1391092 - R+ f967540 ttys000 27:49.01 node --max-old-space-size=1900 cluster.js --port=7100 --workers=4 --noref
501 10263 10261 4006 0 33 0 3413968 113820 - S+ f3dd7e0 ttys000 13:14.86 node cluster.js --port=7100 --workers=4 --noref
501 10264 10261 4006 0 33 0 3821540 563684 - R+ ee0f540 ttys000 3:56.97 node cluster.js --port=7100 --workers=4 --noref
501 10265 10261 4006 0 33 0 3418996 108628 - S+ 13ee4000 ttys000 10:12.39 node cluster.js --port=7100 --workers=4 --noref
501 10266 10261 4006 0 33 0 3396816 103820 - S+ f3dd540 ttys000 13:20.19 node cluster.js --port=7100 --workers=4 --noref

as you can see the cluster has the option, but the worker don't have at all.

@tj
Copy link
Contributor

tj commented Aug 10, 2011

ah ok I see now

@tj
Copy link
Contributor

tj commented Aug 10, 2011

doesn't seem like node exposes those args, not that I can see at least

@gitfy
Copy link
Author

gitfy commented Aug 10, 2011

Node FAQ mentions about this and also i checked the behavior with a single node process and it works.

https://github.com/joyent/node/wiki/FAQ

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants