Using the cluster Module

The cluster module lets you easily implement a cluster of TCP or HTTP servers running in different processes on the same machine but still using the same underlying socket, thus handling requests on the same IP address and port combination. The cluster module is simple to implement and provides several events, methods, and properties you can use to initiate and monitor a cluster of Node.js servers.

Table 9.10 lists the events that can be emitted in a cluster module application.

Image

Table 9.10 Events that can be emitted by the cluster module

Table 9.11 lists the methods and properties you can use in the cluster module to get information such as whether this node is a worker or the master as well as to configure and implement the forked processes.

Image

Table 9.11 Methods and properties of the cluster module

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.133.151.181