Cluster: Process.send stops working

198 views
Skip to first unread message

zaphod1984

unread,
Jun 11, 2012, 7:12:42 AM6/11/12
to nodejs
I'm using process.send() to send messages from a worker to the master
process. (statistics data)
When the cluster is under heavy load (5000-7000req/s) process.send
stops to work after a while e.g. no messages are arriving on the
master anymore.
I used this very simple example: https://gist.github.com/2909389

In the beginning the server works as expected (see the attached
comment), than it doesn't anymore.

I have no idea what could cause this behaviour, it seems like these
messages simply get lost somewhere.

Any suggestions on that?

Thank you!

Ben Noordhuis

unread,
Jun 11, 2012, 9:12:03 AM6/11/12
to nod...@googlegroups.com
Seems to work for me. On what platform and with what version of node
are you seeing this?

zaphod1984

unread,
Jun 11, 2012, 9:45:10 AM6/11/12
to nod...@googlegroups.com
I'm on windows 7 x64, with the current node version (0.6.19)....

type: Windows_NT 
platform: win32 
arch: ia32

is there any chance that this behaviour differs in a linux environment?

Ben Noordhuis

unread,
Jun 11, 2012, 9:56:22 AM6/11/12
to nod...@googlegroups.com
On Mon, Jun 11, 2012 at 3:45 PM, zaphod1984 <mnl...@googlemail.com> wrote:
> I'm on windows 7 x64, with the current node version (0.6.19)....
>
> type: Windows_NT
> platform: win32
> arch: ia32
>
> is there any chance that this behaviour differs in a linux environment?

Yes, probably. Can you file an issue?

George Stagas

unread,
Jun 11, 2012, 4:55:47 PM6/11/12
to nod...@googlegroups.com
I can confirm this, there seems to be a hard limit here
https://github.com/joyent/node/blob/master/lib/child_process.js#L333

On a linux system (CentOS tested) it seems that the write queue is
flushed faster, so it doesn't hit the limit easily, but on Windows it
does and .send() returns false.
Listening to 'drain' on stdin is useless, as the above limit comes
before the stdin throughput limit.
I think the hard limit should be removed and the regular stream
features should be proxied to the process (return false on .write,
continue on 'drain') so we can manage the throughput properly.

2012/6/11 Ben Noordhuis <in...@bnoordhuis.nl>:
> --
> Job Board: http://jobs.nodejs.org/
> Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> You received this message because you are subscribed to the Google
> Groups "nodejs" group.
> To post to this group, send email to nod...@googlegroups.com
> To unsubscribe from this group, send email to
> nodejs+un...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en

zaphod1984

unread,
Jun 12, 2012, 2:47:13 AM6/12/12
to nod...@googlegroups.com
Thanks for your comment, I have filed an issue!
Reply all
Reply to author
Forward
0 new messages