is node.js a one process server, or can it emulate Apache bunch of child processes, each serves a different request, and each is independent from the other (and the cycling of child processes to avoid long term memory leaks).
Is it at all needed when using node.js?
Asked
Active
Viewed 1,399 times
2

Itay Moav -Malimovka
- 52,579
- 61
- 190
- 278
2 Answers
2
Node.js by default is a one process server. For most purposes that's all that's needed (IO limits and memory limits are typically reached before CPU limits).
If you need more processes you can use http://learnboost.github.com/cluster/

generalhenry
- 17,227
- 4
- 48
- 63
-
Can one process handle more than one request at the same time? – Itay Moav -Malimovka Jul 26 '11 at 01:36
-
One node process can handle a very large number of concurrent users, there's very little cost to keeping a connection open. But yes, the process processes them one at a time. – generalhenry Jul 26 '11 at 01:45
2
It's single process and single threaded, due to the fact that Node is non-blocking and event-based. This means this single process can handle many requests at the same time, sending a response back whenever the response is ready.
The key point to note, is that Node is non-blocking.

rafalio
- 3,928
- 4
- 30
- 33