News for hackers. Stuff that matters.
Re:Why Events Are A Bad Idea For High-Concurrency Servers (2... by rdtsc on Friday May 02, 2014 @03:36AM (#7684515)
A multiprocess web server (like Apache for example) would usually not have callback chains. It would listen on a socket, in the accept() call, and when a new connection comes in it would return with a client connection socket and then spawn a process (or pick one from an existing pool) and let it handle it. It wouldn't have any callback chains (or I guess you can think of the spawn() / fork() / pick_from_process_pool() as 1 callback ).

If it is OS processes (or Erlang lightweight processes) then you gain failure isolation. If something has gone wrong and a child process crashes, only that request will fail, others will keep working. Real OS processes are usually on the heavy side.

In Go you might create a channel and spawn a goroutine for example.

Re:Why Events Are A Bad Idea For High-Concurrency Servers (2... by oelmekki on Friday May 02, 2014 @03:45AM (#7684531)
Ok, thanks. So I guess we're talking about events as a problem for things like node.js or eventmachine.

Out of curiosity, you mentioned nginx as using callback chain ; has it any difference with apache in that regard ?

Re:Why Events Are A Bad Idea For High-Concurrency Servers (2... by rdtsc on Friday May 02, 2014 @04:07AM (#7684579)
It is usually consumes less memory for the same amount of concurrent connections. The callback chain for it should be pretty short. Instead of spawning a process, it would get an event that there is data on a client socket. Then parse http (this might happens across multiple callbacks, and then handle it (serve the file).