Here is a quick example to show how to manage an app in a cluster. Node’s (v0.6.x) cluster API is simple, but it takes a few extra steps to make the cluster management scriptable. The example below shows how.
You can then do
to start app in a cluster, and then
to cleanly stop the cluster or
node cluster-sample.js shutdown
to gracefully shutdown.