开发者

is node.js a one process server?

is node.js a one process server, or can it emulate Apache bunch o开发者_运维百科f 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?


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/


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜