I have noticed a popular aversion to "fork", and I don't quite understand it. It uses the "copy on write" technique, and it seems very fast in my benchmarks. For example, I have a benchmark where I can spawn 1000 or more processes right from the command line, all banging away on shared files with locking, and it all seems very fast and stable, every time. I don't even bother with pre-forking. But I do make heavy use of "Keep-Alive", with appropriate guards against abuse under heavy load. I'm a big fan of the simplicity of fork and blocking I/O, but I'm sure other people have different requirements and constraints they might want to share here.
Spawning a new process is not the same thing as forking, but people often forget this bit. This post wasn't about forking.
I thought that spawning a new process was the same as forking. What am I missing?
Thanks, but I already know what fork does. My point is that "fork" is precisely how one spawns a new process, and there is no other way to do so.
in the real world, forgetting "var" doesn't bring down web servers.
In the real world people use node.js for other stuff that web servers. Like background processing that involves a lot of I/O, therefore the bias against spawning a shell has no ground.