Best way to run many node.js demos on one server

I'm starting to use node.js and am looking for the best way to host multiple node.js demos (>20) on one server. My only requirement is that an error in one not take down the rest.

So far I've looked at:

  • Multiple node.js instances - this works but the overhead is quite high with a large number of demos processes
  • Express front end routing to individual demo files - no overhead but one error brings everything down
  • Using the cluster module to run each module as a sub-process - I'm currently researching this option, seems promising but requires some work (and cluster is still only experimental)

Can anyone suggest a better way? How have other people done it?

I am taking the something like approach #1 and #3 combined. I have apache (yeah, I know, lame, but I do share this server with others who need/want it), and I use mod_proxy as a route to the webapps. Each app then has its own node.js daemon.

That way I can run each app on its own port and route there from apache. Probably not good for your use case, as I only have 2-3 weabpps on at the time.