> Remy Maucherat wrote: > > > > > With my design, you still need one thread/request but only for the > > > time required to process container.invoke() > > > > In the real world, the servlets and JSPs are the thing which take by far the > > most time to complete, so I'm not sure you wouldn't end up spending a lot of > > time in the threaded part. > > > > There was a long discussion on the advanced-servlets list > a while back. That discussion concluded that the NIO looked > most promising for: > > - Cleanly waiting for persistent connections (which take > up a connector thread but don't really need to) You > can kinda sorta do this already with the existing java.io > classes, but NIO is better. This is a relatively easy > win. > > - Serving static content. It's not just the non-blocking > io, serving from memory mapped files is a beguilingly > easy (but maybe not always the best) way to improve file > serving performance. > > Using NIO to reduce the time service() needed to tie up > a thread is fun, but seemed unlikely to help very much in > practice. And of course the optimized char conversion > stuff, but that's obviously useful and therefore boring.
I agree on both the points above. Especially the first one actually, since you can avoid wasting a thread on waiting, and use all of them to do active work if needed. For the second point, Catalina uses a servlet to do the static files serving. I suppose the connector could do some optimization and serve some resources itself, but that's a bit complex, and not as clean as the current solution. I like that difference between a fun optimization and a useful optimization :) At the moment, a lot of useful optimization work still has yet to be done. > I'm pretty sure newesh versions of Jetty include a first > pass at integrating NIO, so anybody that's interested > might want to take a look. > > There's some fairly bogus (but still kinda interesting) > benchmark results using NIO-like routines to serve static > files at distributopia.com. (Sun says no NIO-bmarks until > it's out of beta, so I used Matt Welsh's NBIO code) I didn't know. They're annoying ... Remy -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>