mirror of
https://github.com/nodejs/node-v0.x-archive.git
synced 2026-04-28 03:01:10 -04:00
e72cd415adf2ca12daddc001cc3fe953cdb4b507
Empirical evidence suggests that OS-level load balancing (that is, having multiple processes listen on a socket and have the operating system wake up one when a connection comes in) produces skewed load distributions on Linux, Solaris and possibly other operating systems. The observed behavior is that a fraction of the listening processes receive the majority of the connections. From the perspective of the operating system, that somewhat makes sense: a task switch is expensive, to be avoided whenever possible. That's why the operating system likes to give preferential treatment to a few processes, because it reduces the number of switches. However, that rather subverts the purpose of the cluster module, which is to distribute the load as evenly as possible. That's why this commit adds (and defaults to) round-robin support, meaning that the master process accepts connections and distributes them to the workers in a round-robin fashion, effectively bypassing the operating system. Round-robin is currently disabled on Windows due to how IOCP is wired up. It works and you can select it manually but it probably results in a heavy performance hit. Fixes #4435.
Evented I/O for V8 javascript. 
To build:
Prerequisites (Unix only):
* Python 2.6 or 2.7
* GNU Make 3.81 or newer
* libexecinfo (FreeBSD and OpenBSD only)
Unix/Macintosh:
./configure
make
make install
If your python binary is in a non-standard location or has a non-standard name, run the following instead:
export PYTHON=/path/to/python
$PYTHON ./configure
make
make install
Windows:
vcbuild.bat
To run the tests:
Unix/Macintosh:
make test
Windows:
vcbuild.bat test
To build the documentation:
make doc
To read the documentation:
man doc/node.1
Resources for Newcomers
Description