Hacker News new | ask | show | jobs
by moonpolysoft 5722 days ago
Scalability, eh? What about that whole "scale beyond a single CPU" thing. I hear it's quite the rage.
3 comments

If 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.
There'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.
So 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.
That's a really good point. What sort of message passing support would you like to see in node? I have some free time.
Being 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.)
Translation: 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.

What about that whole "fork" thing. I hear it's quite the rage
Your OS's copy-on-write page policy loves when you fork things using mark-and-sweep garbage collection. It is full of rage.
Last time I checked Node.js was not able to invoke fork.