You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2014/03/24 13:18:58 UTC

svn commit: r1580821 - in /tomcat/trunk/webapps/docs: changelog.xml web-socket-howto.xml

Author: markt
Date: Mon Mar 24 12:18:57 2014
New Revision: 1580821

URL: http://svn.apache.org/r1580821
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=56304
WebSocket + BIO HTTP + Production = bad idea

Modified:
    tomcat/trunk/webapps/docs/changelog.xml
    tomcat/trunk/webapps/docs/web-socket-howto.xml

Modified: tomcat/trunk/webapps/docs/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1580821&r1=1580820&r2=1580821&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Mon Mar 24 12:18:57 2014
@@ -92,6 +92,10 @@
         operation because the web application is already being serviced, report
         an error rather than reporting success. (markt)
       </fix>
+      <fix>
+        <bug>56304</bug>: Add a note to the documentation about not using
+        WebSocket with BIO HTTP in production. (markt) 
+      </fix>
     </changelog>
   </subsection>
 </section>

Modified: tomcat/trunk/webapps/docs/web-socket-howto.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/web-socket-howto.xml?rev=1580821&r1=1580820&r2=1580821&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/web-socket-howto.xml (original)
+++ tomcat/trunk/webapps/docs/web-socket-howto.xml Mon Mar 24 12:18:57 2014
@@ -49,7 +49,26 @@
    code</a>.</p>
 </section>
 
+<section name="Production usage">
+<p>Although the WebSocket implementation does work with any of the HTTP
+connectors, it is not recommended to the WebSocket with the BIO HTTP connector
+as the typical uses of WebSocket (large numbers of mostly idle connections) is
+not a good fit for the HTTP BIO connector which requires that one thread is
+allocated per connection regardless of whether or not the connection is idle.
+</p>
+
+<p>It has been reported (<bug>56304</bug>) that Linux can take large numbers of
+minutes to report dropped connections. When using WebSocket with the BIO HTTP
+connector this can result in threads blocking on writes for this period. This is
+likely to be undesirable. The time taken for the connection to be reported as
+dropped can be reduced by using the kernel network parameter
+<code>/proc/sys/net/ipv4/tcp_retries2</code>. Alternatively, one of the other
+HTTP connectors may be used as they utilise non-blocking IO enabling Tomcat to
+implement its own timeout mechanism to handle these cases.</p>
+</section>
+
 <section name="Tomcat WebSocket specific configuration">
+
 <p>Tomcat provides a number of Tomcat specific configuration options for
    WebSocket. It is anticipated that these will be absorbed into the WebSocket
    specification over time.</p>



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


Re: svn commit: r1580821 - in /tomcat/trunk/webapps/docs: changelog.xml web-socket-howto.xml

Posted by Mark Thomas <ma...@apache.org>.
On 24/03/2014 13:04, Rémy Maucherat wrote:
> 2014-03-24 13:18 GMT+01:00 <ma...@apache.org>:
> 
>> Author: markt
>> Date: Mon Mar 24 12:18:57 2014
>> New Revision: 1580821
>>
>> URL: http://svn.apache.org/r1580821
>> Log:
>> Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=56304
>> WebSocket + BIO HTTP + Production = bad idea
>>
> Shouldn't the BIO connector be deprecated in 8.0 ? That would be simpler
> to understand.

With the increasing amount of non-blocking IO in the various APIs, the
writing is certainly on the wall for the BIO connector. My current
thinking is that it should be dropped in 9.0.x

In terms of when it is deprecated in 8.0.x, I'd like to delay that to
give the NIO connector a chance to settle down as we have only just
switched over to that as the default connector. I'm expecting the
increased usage of NIO to identify some edge case bugs we haven't fixed
yet. I'd be happier deprecating BIO after a reasonable period of stable
releases with the NIO connector as the default.

Mark

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


Re: svn commit: r1580821 - in /tomcat/trunk/webapps/docs: changelog.xml web-socket-howto.xml

Posted by Rémy Maucherat <re...@apache.org>.
2014-03-24 13:18 GMT+01:00 <ma...@apache.org>:

> Author: markt
> Date: Mon Mar 24 12:18:57 2014
> New Revision: 1580821
>
> URL: http://svn.apache.org/r1580821
> Log:
> Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=56304
> WebSocket + BIO HTTP + Production = bad idea
>
> Shouldn't the BIO connector be deprecated in 8.0 ? That would be simpler
to understand.

Rémy