You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Terry ST SY/OGCIO <ts...@ogcio.gov.hk.INVALID> on 2022/10/20 09:33:56 UTC

BIO connector vs NIO connector

Hi ,

Check on the major changes on Tomcat 7 to Tomcat 9. (One of the major change we initially spotted is the BIO connector used in Tomcat 7 for connector setup was removed in Tomcat 9: https://tomcat.apache.org/migration-9.html#BIO_connector_removed)

May I know the major difference on BIO connector and NIO connector ? if NIO have better performance, where can I get the bench mark comparison report ?

Regards,
Terry



Re: BIO connector vs NIO connector

Posted by Christopher Schultz <ch...@christopherschultz.net>.
Mark and Terry,

On 10/20/22 06:35, Mark Thomas wrote:
> On 20/10/2022 10:33, Terry ST SY/OGCIO wrote:
>> Hi ,
>>
>> Check on the major changes on Tomcat 7 to Tomcat 9. (One of the major 
>> change we initially spotted is the BIO connector used in Tomcat 7 for 
>> connector setup was removed in Tomcat 9: 
>> https://tomcat.apache.org/migration-9.html#BIO_connector_removed)
>>
>> May I know the major difference on BIO connector and NIO connector ?
> 
> https://tomcat.apache.org/tomcat-8.0-doc/config/http.html#Connector_Comparison
> 
> Note also that the APR/native Connector has been deprecated and removed 
> in Tomcat 10.1.x onwards.
> 
>> if NIO have better performance, where can I get the bench mark 
>> comparison report ?
> 
> The raw performance difference for a single connection is marginal.

While all this is true, it's not relevant: Tomcat has dropped support 
for the BIO connector, therefore the performance is irrelevant.

If you are looking for likely performance impacts on your own servers, 
what you'll likely see is that CPU usage goes up a few percent (there is 
some cost to maintaining non-blocking communication), throughput stays 
about the same (your NIC's performance is what dominates performance, 
here), and you can handle MANY more simultaneous connections than you 
were able to before (like 2-3 orders of magnitude).

-chris

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: BIO connector vs NIO connector

Posted by Mark Thomas <ma...@apache.org>.
On 20/10/2022 10:33, Terry ST SY/OGCIO wrote:
> Hi ,
> 
> Check on the major changes on Tomcat 7 to Tomcat 9. (One of the major change we initially spotted is the BIO connector used in Tomcat 7 for connector setup was removed in Tomcat 9: https://tomcat.apache.org/migration-9.html#BIO_connector_removed)
> 
> May I know the major difference on BIO connector and NIO connector ?

https://tomcat.apache.org/tomcat-8.0-doc/config/http.html#Connector_Comparison

Note also that the APR/native Connector has been deprecated and removed 
in Tomcat 10.1.x onwards.

> if NIO have better performance, where can I get the bench mark comparison report ?

The raw performance difference for a single connection is marginal. You 
could probably construct a test that demonstrates either is a few 
percentage points "better" than the other.

The key difference is scalability. Look at the descriptions for 
maxConnections, maxThreads and disableKeepAlivePercentage.

With default settings, NIO can support orders of magnitude more 
connections using HTTP keep-alive. That should lead to performance 
benefits in terms of reduced connection set-up time - i.e. lower latency.

Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org