5 ms·
Scalability, eh? What about that whole "scale beyond a single CPU" thing. I hear it's quite the rage.
by moonpolysoft 16y ago
Scalability, eh? What about that whole "scale beyond a single CPU" thing. I hear it's quite the rage.
- a2800276 16y agoWhat about that whole "fork" thing. I hear it's quite the rage
- moonpolysoft 16y agoLast time I checked Node.js was not able to invoke fork.
- simonw 16y agoIt can spawn child processes: http://nodejs.org/api.html#child-processes-89 http://nodejs.org/api.html#child-processes-89 http://www.sitepen.com/blog/2010/07/14/multi-node-concurrent-nodejs-http-server/ http://www.sitepen.com/blog/2010/07/14/multi-node-concurrent...
- KirinDave 16y agoYour OS's copy-on-write page policy loves when you fork things using mark-and-sweep garbage collection. It is full of rage.
- pjscott 16y agoIf node can scale beyond a single machine, then it can scale beyond a single CPU on a machine. I know I'm oversimplifying, but you're oversimplifying more.
- moonpolysoft 16y agoSo last time I looked at it, Node.js did not have any language level or even library primitives for message passing. At least nothing beyond making you open a socket and work out your own protocol for IPC. I'll grant you that is the standard scalability story for most languages running on multiple hosts. However it seems deficient if one's goal is to make use of most of the cores on modern server hardware.
- pjscott 16y agoThat's a really good point. What sort of message passing support would you like to see in node? I have some free time.
- silentbicycle 16y agoBeing able to stream arbitrary data as JSON already get you a lot of flexibility. Can you stream Javascript functions, though? (You can in Lua, but doing so w/ closures is tricky.)
- rubyrescue 16y agoThere's nothing in node that provides mechanisms for cross process scalability. Compared to Erlang, for instance, which provides mechanisms for message passing and scaling past one node, and even one node can efficiently use multiple cores. Node is quite fast but not scalable in that sense.
- rbranson 16y agoTranslation: per-client, it uses very little resources, and V8 garbage collection is a good fit for the type of services Node.js targets. It's mostly about memory. ... and yes, as others have pointed out, Node.js supports process forking, which is arguably the better model for CPU scaling in these types of services.