Is there any way to control the distribution of request to workers in cluster?

72 views
Skip to first unread message

darcy

unread,
Mar 22, 2012, 6:29:56 AM3/22/12
to nod...@googlegroups.com
When using cluster module, the requests from different connections are distributed to workers randomly, which inconvenience the summary of client ip. Is there any way to distribute request from the same ip to fixed worker process? Or in future versions? I think it's useful in some cases.

Ryan Schmidt

unread,
Mar 22, 2012, 6:33:40 AM3/22/12
to nod...@googlegroups.com

On Mar 22, 2012, at 05:29, darcy wrote:

> which inconvenience the summary of client ip

It does what?


darcy

unread,
Mar 22, 2012, 11:15:01 PM3/22/12
to nod...@googlegroups.com
In my case, limiting the connections and requests from same ip.
In other cases, such as some data should be shared between all connections from same ip.
 
在 2012年3月22日星期四UTC+8下午6时33分40秒,ryandesign写道:

billywhizz

unread,
Mar 23, 2012, 2:43:40 AM3/23/12
to nod...@googlegroups.com
requests are not distributed - connections are. the operating system takes care of distributing connections across the pool of processes that are listening on the socket. this is handled internally by the kernel so in effect you have a layer 4 load balancer and there is no way of routing/proxying requests to specific processes from user space. sounds to me like you need to use a reverse proxy if you want control over which client connections get routed to which processes...

darcy

unread,
Mar 23, 2012, 3:48:49 AM3/23/12
to nod...@googlegroups.com
Got it. Thank you.
It's really weakness cause by lack of multi threads support.

在 2012年3月23日星期五UTC+8下午2时43分40秒,billywhizz写道:

Matt

unread,
Mar 23, 2012, 10:28:12 AM3/23/12
to nod...@googlegroups.com
No, it's weakness in assuming you'll always have everything on one host. If you want stuff to hang around until the client reconnects next time use external storage, such as Redis.

--
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

Reply all
Reply to author
Forward
0 new messages