0

My understanding is that node.js is designed to scale by adding processes rather than by spawning threads in a process. In fact, from watching an awesome introductory video by Ryan Dahl, I get the idea that spawning threads is forbidden in node.js. I like the simplicity of this approach, but I am concerned that there might be downside when running on Windows, since processes creation is more expensive on Windows than Linux.

Given modern hardware and the fact that node.js processes can be expected to be relatively long running, does process overhead still create a significant advantage for Linux when considering hosting node.js? To put it in concrete terms, if we assume an organization that is using the Windows stack only, but is planning a big move onto node.js, is there a point in considering a new OS because of this issue?

Community
  • 1
  • 1
Paul Keister
  • 12,851
  • 5
  • 46
  • 75
  • Probably yes. But you have to measure it yourself to understand if that matters to you. And going to Linux won't hurt much (but there is a learning process to follow). – Basile Starynkevitch Feb 27 '12 at 08:06

1 Answers1

0

No. Node.js runs in only 1 process and doesn't spawn processes during execution.

The reason you might have gotten the impression that node uses processes to scale is because you can add a process per CPU core to enable node to take advantage of your multicore computer (you'll need a load balancer like solution for this tho). Still: you don't spawn processes on the fly. So yes, you can run node perfectly fine on Windows (or Azure) without too much of a performance hit (if any).

Jan Jongboom
  • 26,598
  • 9
  • 83
  • 120