To view parent comment, click here.
To read all comments associated with this story, please click here.
JAlexoid,
"Quite a common mistake. Comparing async performance to performance of Apache. Those don't highlight the differences in scalability of non-blocking IO, but demonstrate that Apache is big."
In the past I've done the socket benchmarks myself, apache was just an example, feel free to substitute whatever example you like. Blocking socket IO implies using either multi-process or multi-threaded models, I hope that we can agree that the forking multi-process model is the least scalable.
There's nothing wrong with the multi-threaded blocking model, I don't critisize anyone for using it. However it does imply more memory/cpu overhead than the non-blocking model due to each client using it's own stack and the requirement of synchronization primitives that are usually unnecessary with the async model. Additionally the multithreaded solution does not increase concurrency over an asynchronous solution when the number of async handlers equals the number of cores, so right there you've got all the ingredients for async to come out ahead.
Mind you I think the difference is negligible when the number of concurrent users is low, but async really shines with many concurrent connections (10K+).
There is no form of IO that will imply high scalability without multi-threading or multiple processes.(nginx, lighttpd and node.js use multiple processes to scale)
What gave you the impression that:
A) threads are expensive in memory or CPU. They are quite cheap these days.
B) synchronization of blocking IO isn't replaced with something similar in nonblocking IO. (It always is)





Member since:
2009-05-19
As a popular example, take a look at the scalability differences for a traditional multi-process web server (apache MPM) versus modern asynchronous ones:
http://whisperdale.net/11-nginx-vs-cherokee-vs-apache-vs-lighttpd.h...
Quite a common mistake. Comparing async performance to performance of Apache. Those don't highlight the differences in scalability of non-blocking IO, but demonstrate that Apache is big.