Mark,

On 5/1/15 1:28 PM, Mark Thomas wrote:
> On 01/05/2015 15:03, Rémy Maucherat wrote:
>> 2015-05-01 11:55 GMT+02:00 Mark Thomas <ma...@apache.org>:
> 
>>> So, should we drop one of NIO or NIO2 in Tomcat 9? If not, why not? If
>>> yes, which one?
>>>
>>> I volunteer to help maintain NIO2 for the time being, so I am not in favor
>> of removing it at the moment. Unfortunately, I think all three connectors
>> have some good points.
>>
>> APR:
>> - Blocking IO
>> - OpenSSL (for the time being)
> 
> If you can get OpenSSL working with the Java connectors then that opens
> up the  question why keep the APR/native connector. But we aren't there yet.

It looks like Harmony had an OpenSSL crypto provider for Java, and it
seems that Android might still be caring for it. Jean-Frederic expressed
some interest in the past in having a JSSE provider based upon OpenSSL
as well. I'm not sure if there's corporate will behind that or not.

One of these days, the JRE is going to fix all their bugs preventing
hardware-accelerated crypto, and the difference between JSSE and OpenSSL
is going to be reduced.

>> - Sendfile
>>
>> NIO:
>> - It's been around longer :)
>> - Sendfile
>>
>> NIO2:
>> - Modern async IO
>> - Scatter / gather IO that can be exposed and taken advantage (see the new
>> IO calls I added; implementing them with APR and NIO is going to be a whole
>> lot more convoluted ...)
>> - Probably HTTP/2 and Servlet.next will take advantage of it just like
>> websockets did
> 
> WebSockets didn't take advantage of it scatter/gather. Neither did it
> take advantage of the async style of API.
> 
>> I don't think NIO has gotten any better, it's still the most horrendous IO
>> API imaginable as far as I am concerned. Of course, you can use frameworks
>> and stuff but ... I agree to keep it as well, since as you say it's more
>> mature and stable, but that's about it.
> 
> The main driver for this thinking is reducing complexity in the
> connectors. Having to support both poller style and async style basic
> I/O creates complexity. If we only supported one style the I/O code
> could be a lot cleaner.

That suggests that getting rid of NIO also implies getting rid of APR.
IS that your thinking?

> Overall, I think I prefer the async style. It is much easier to simulate
> blocking and requires less supporting code (no pollers etc).
> 
> But, APR uses the poller style and it has much better SSL performance.
> 
> Thinking ahead (not sure how far, maybe Tomcat 9 at the outside) but if
> we had OpenSSL working with NIO.2 and performance was similar to the
> APR/native connector I'd be all for dropping NIO and APR/native in
> favour of NIO2 and with the option to use OpenSSL or JSSE for SSL.
> 
> Is that too extreme?

It's going to need a huge amount of testing, obviously. Ognjen and Felix
found some problems with the NIO2 implementation in the latest 8.0.x
candidate (though NIO2 is still considered "experimental" in Tomcat 8),
so it's obviously not ready for prime-time just yet.

One connector to rule them all. It definitely sounds like a good goal.

-chris

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to