How many child processes can a node server spawn?

I'm doing a mathematical computation that is CPU intensive therefore I need to spawn a child-process using node.js because it may block the main even loop. It's not necessarily memory intensive but it is CPU intensive. Think for example a fibonacci number generator.

My only fear is that I might have alot of users, thousands at the same time doing this job and so that will mean that I will have thousands of processes running on my linux box because node.js spawns a new process every time child_process is run. My question is how many processes can a linux server handle?

Note: My server is a dual-core linux VM with 4gb memory. I.e., nothing fancy. Note#2: I'm looking for a simple ballpark figure here. In the thousands? Thanks.

Two points...

  1. If you can cache/memoize results depending on your scenario, do so.
  2. I would look into using a generic-pool, to limit your use of sparse resources. By wrapping your controller with a node-pool you can limit yourself to say 10 or 20 active workers at a given time. I wouldn't do more than 2x the number of physical cpus myself, though how many threads you can run really depend on the workers/system. If all the worker processes are the same, it's more predictable.