I ran a quick test to quantify the cost of IPC between workers and the master in a node.js cluster. The test code is below (which I borrowed from node’s docs).
On receiving an HTTP request, each worker process sends a message to the master. I ran three variations – no messages, send one message, and send 5 messages.
- Don’t send a message.
- Send one message per request
- Send five messages per request
These are done on Ubuntu 11.04 on a quad-core Xeon box using node 0.6.12.