Christopher,
Thx for response, pleas confirm or deny if I understand well.

BIO uses thread per http connection (tcp connection). (Shame I didn't
realize it!)
NIO uses thread per request.

With NIO thread is returned to pool as soon as request is finished (doGet
ends).
With BIO thread is returned to pool only when tcp connection is closed !!!
Given
  http://kb.mozillazine.org/Network.http.keep-alive.timeout - Amount of
time in seconds to keep keep-alive connections alive. Default: 115 seconds.
  default tomcat keepAliveTimeout 60 s
  default tomcat maxThreads is 200
With 200 browsers with ajax pooling server every 50 seconds tomcat
connector thread pool will be depleted and client no 201 will not be able
to connect to tomcat ?
So with default configuration tomcat 7 will have problem with just 201
on-line clients of an ajax application (with only 4 requests/second) ?

Why is BIO connector still default one in tomcat 7 server.xml ? Is there
any problem with backward compatibility (don't think so, cause than BIO
wouldn't be totally removed in 8.5, but left available ) ?

BR
Jakub



On Mon, May 23, 2016 at 7:31 PM, Christopher Schultz <
ch...@christopherschultz.net> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
> Jakub,
>
> On 5/23/16 11:38 AM, Ja kub wrote:
> > In which scenario nio connector will outerform basic io connector
> > and vice versa ?
>
> In Tomcat 8.5 and higher, NIO will always outperform the BIO connector
> because the BIO connector has been completely removed. BIO cannot be
> meaningfully-used with any asynchronous use such as Comet and, more
> recently, Websocket.
>
> NIO will always outperform BIO in other cases when you are measuring
> the performance of requests-per-thread. With NIO, you can handle a
> much higher number of simultaneous requests with a smaller number of
> request-processing threads, especially when HTTP keepalive is being
> used (which should pretty much be "always").
>
> In terms of throughput, the difference between NIO and BIO is
> negligible. In terms of CPU, NIO is a bit more stressful for the CPU
> than BIO, but the benefits far outweigh the difference.
>
> > What would be high level design of corresponding performance tests
> > showing advantages of each connector ?
>
> Jean-Frederic has some recently-presented slides comparing BIO to NIO.
> I'll see if I can find them and put them online.
>
> - -chris
> -----BEGIN PGP SIGNATURE-----
> Comment: GPGTools - http://gpgtools.org
> Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
>
> iQIcBAEBCAAGBQJXQz6DAAoJEBzwKT+lPKRYnJsP/j6Aa3+Ss86WdMfWZ1+j2O+j
> qoplBMOPicZDsfnucG1W8ztUprJcgjzcnxFbww8jvpjQs8xuoF/enRVY4Lq2nIbc
> vIU5xVB684CKL401Ram0hIdJLSkrl/y4XaeLeywOwsXVx6qvIrML8qdsHUQLp1xC
> g6kZqaqhAibxKT1LuK9/WtURXXYMWc70lt7bTu7y6PRLybUWnYvBMwQWGMsavKKu
> jVALCJeJznEos3TdM5P/1C2k/27M1Mh+CyPIbL/az2lVP/7S7Q7RydBrh205WU6r
> AvDJ8KA8mbhiQ57DDhK96KOXcCjDinGYOBGMdGfY8Uv0KGrtz6s6bDYx4O40UKtH
> bRLNxNqz7/hfl8Pzmgho+UOg2/vAIIUcbZ78+i2Hx+tQKiNIASbg73LJ34V1Ms24
> iu0QHNpCQI9MaYgnjXe40a3bwPYK79wzD2i459bxkiRmneuBaaH1KQ9PsG3amVgW
> 56iCbyfAvfnK5Ooqp+ag038kUfqWa//ACtLXKGsGjEa5V9iKiTrDcKUNxysC5zsR
> uAr8tXqeNuAPKZA+ET0oCKY/gUa4iU+9rlMqW3XXrWDS7BkQKng44W0h3bEo5evt
> Vy5/isS8bDQ+53ZyQr3jatneTpHz4Ka+BOFkrRgNY2kkTU+PbFwLV8lUB4fZgwY8
> +SqV8S0CfEfxUGrqHrNb
> =e1cY
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>

Reply via email to