I would have to agree with Remy here. The example given doesn't really prove anything in my mind. Sure, having NIO will allow you to use a set number of threads to handle inbound requests. Even without running a benchmark, it is obvious a NIO approach can scale better. A better example of how to use NIO is SEDA, which uses a staged event driven architecture with NIO. For those who don't know SEDA, it can handle 10K connections and over 2K req/second (http://www.eecs.harvard.edu/~mdw/proj/seda/httpload-bench/index.html). I took a look a the source included in the article. the implementation is just a very simple test, it doesn't really do anything and is in no way comparable to Tomcat, which has to comply to the servlet spec. writing non-blocking code is sufficiently difficult that it increases the development time compared to the current servlet specification. the reason the servlet spec team chose a single threaded approach is the ease of development, not because they weren't aware of NIO. This isn't the first time the topic has come up. peter lin
Remy Maucherat <[EMAIL PROTECTED]> wrote: Shapira, Yoav wrote: > Howdy, > Have people read this article? I find it interesting. If you haven't, > it's a benchmark comparison of a java.nio-based server with tomcat 5. > The benchmark server is tiny and contains only a small subset of > functionality. I am also not sure of how representative of the > real-world this benchmark is, because all clients are set to keep-alive. > Is that typical? What else do people think about this article? Complete BS ;) The model will only work for select few applications. What if you have processing that requires 1s ? We're building an application server here (I hope). NB I/O vs B I/O is simply the same as comparing cooperative mutitasking with preemptive multitasking. The first one is way easier to implement in a very efficient way, but in practice there's a reason why everyone switched: it just doesn't work, except for special, controlled environments. IMO, the underlying OSes need to be fixed (Linux 2.6 does this, I believe). Note that this is not about classic I/O versus NIO: NIO can be used in either blocking or non blocking modes. Rémy --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free web site building tool. Try it!