tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Thomas <ma...@apache.org>
Subject Re: Scalable WebSocket broadcast with Tomcat 7
Date Mon, 03 Jun 2013 08:25:34 GMT
On 02/06/2013 21:12, Dimitri wrote:
> Hi,
> 
> I am developing a collaboration webapp using Tomcat 7 implementation of
> WebSockets. Imagine we have a 1000+ of connected clients, each of them
> having his own WsOutbound. How do we implement broadcast messages in a
> scalable way? Yet I've seen only examples that do iterate over connected
> clients and send messages in a sequential manner. Obviously, this
> approach doesn't scale to hundreds an thousands of clients.
> 
> I've yet come up with a workaround using a fixed ThreadPool executor of
> some 50 threads that do the work in parallel, however, this approach is
> far from perfect, too. I'm wondering if there exists more elegant,
> standard way to do the same, probably employing NIO and multiplexing?

The Tomcat 7 implementation uses blocking IO within a WebSocket frame so
there is no easy way to do what you want to do.

At some point (still TBD) the JSR-356 implementation from Tomcat 8 will
be back-ported to Tomcat 7.

Mark

> I've heard that this will be available in JSR-356 out-of-the-box, but
> the application is going to enter production soon, with TomEE 1.6.0 as
> target platform.
> 
> Thanks!
> Dimitri
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 


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


Mime
View raw message