You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by "Setera, Craig" <Cr...@Kingland.com> on 2002/05/20 17:17:12 UTC

Using NIO package for Tomcat connector?

Has there been any discussion on building a connector around the NIO package
in Java 1.4?  I just read an interesting article in the latest Java
Developer's Journal about a web server built using this support and it
looked excellent.  Using NIO would lower the number of required threads and
buffers/objects that would need to be created.  Obviously it would be
dependent on 1.4, so it could not be the default connector.  But, I believe
it would be nice to have the option.

Thanks,
Craig

Craig Setera
Sun Certified Java Programmer/Developer/Web Component Developer
Senior Software Architect, Kingland Systems Corporation



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Using NIO package for Tomcat connector?

Posted by Remy Maucherat <re...@apache.org>.
> Has there been any discussion on building a connector around the NIO
package
> in Java 1.4?

Yes.

> I just read an interesting article in the latest Java
> Developer's Journal about a web server built using this support and it
> looked excellent.  Using NIO would lower the number of required threads

No, because the J2EE model mandates 1 thread <-> 1 request, and implies
blocking IO (because the servlet will use an IS to read the request body no
matter what).
You can save a few threads during the time you wait between requests when
using HTTP/1.1 connection persistence, but IMO it is not worth the
throughtput loss and increased complexity of the HTTP/1.1 processor.

> and buffers/objects that would need to be created.

Tomcat already uses NIO-like reusable buffers, so there's no gain here (and
C2B conversion will automatically use the new NIO converters).

> Obviously it would be
> dependent on 1.4, so it could not be the default connector.  But, I
believe
> it would be nice to have the option.

I'm quite sure the connector is no longer a limitation for real world
webapps (Jasper is, assuming you're not using a database too much, so we're
now working on that instead). OTOH, NBIO is really cool if you want to build
a HTTP/1.0 or HTTP/1.1 file server.

Remy


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Using NIO package for Tomcat connector?

Posted by co...@covalent.net.
On Mon, 20 May 2002, Setera, Craig wrote:

> Has there been any discussion on building a connector around the NIO package
> in Java 1.4?  I just read an interesting article in the latest Java
> Developer's Journal about a web server built using this support and it
> looked excellent.  Using NIO would lower the number of required threads and
> buffers/objects that would need to be created.  Obviously it would be
> dependent on 1.4, so it could not be the default connector.  But, I believe
> it would be nice to have the option.

Yes, we discuss it few times. 

For HTTP it won't give us too much, even if we do pool() we still need
to use the same thread model. But for the JK2 connector I believe using 
direct buffers would give us a nice performance gain, and I'm working 
on this. 

Direct buffers are IMHO the most important aspect of NIO, it provides a
much better way to communicate between java and C.


Costin


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>