tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Thomas <>
Subject Re: websockets holding on to threads.
Date Wed, 10 Apr 2013 01:35:35 GMT
On 08/04/2013 15:32, Christopher Schultz wrote:
> Hash: SHA256
> Chuck,
> On 4/8/13 8:30 AM, Caldarale, Charles R wrote:
>>> From: Anton Piatek1 [] Subject: Re:
>>> websockets holding on to threads.
>>> My thinking about it being a bug is that to support N clients
>>> with websockets, you need N threads available on tomcat, even
>>> though they are only getting updates every x seconds.
>> I don't know if this will have any effect, but try using the NIO
>> <Connector> instead of the BIO one.  Set the protocol attribute to
>> org.apache.coyote.http11.Http11NioProtocol and see what happens.
> +1
> I think there was a recent discussion about using Websocket under BIO:
> basically, you go back to sucking again.

Short version:

BIO = 1 thread per connection (doesn't scale)

NIO/APR = 1 thread per currently processed frame

i.e. NIO/APR allocate a thread to process an incoming frame and that 
thread stays allocated until the frame has been completely read. Putting 
it another way NIO and APR are non-blocking between frames and blocking 
within frames. Writes always block.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message