tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Thomas <ma...@apache.org>
Subject Re: Is the Tomcat JSR-356 WebSocketClient-AsyncIO threadpool configurable?
Date Wed, 06 Nov 2013 18:06:09 GMT
On 06/11/2013 18:01, Bob DeRemer wrote:
> 
> 
>> -----Original Message----- From: Mark Thomas
>> [mailto:markt@apache.org] Sent: Wednesday, November 06, 2013 12:46
>> PM To: Tomcat Users List Subject: Re: Is the Tomcat JSR-356
>> WebSocketClient-AsyncIO threadpool configurable?
>> 
>> On 06/11/2013 17:07, Bob DeRemer wrote:
>>> As part of loading testing our JSR-356 websocket implementation 
>>> (running in Tomcat 7.0.48), we've created a subset of Tomcat jars
>>> to use as our "client" jsr-356 jars.
>>> 
>>> Q1: are there any plans to create a client jsr-356 jar - similar
>>> to the Tyrus RI?
>> 
>> No. It wouldn't be that hard but you could just use the current
>> JARs. The server classes don't add that much.
>> 
>>> Secondly, during this load testing, we have experienced
>>> occasional IO-related issues that we can't quite pin down, but
>>> they all seem to be client-side.  Usually, this occurs when we
>>> have 20K (or more) websocket connections in the test client.
>>> NOTE:  we are only using 50 - 100 threads in an executor against
>>> the collection of open websockets, so it doesn't seem like a huge
>>> number of threads sending/receiving messages.
>>> 
>>> If appears that Tyrus supports configuration of the client side 
>>> threadpool, but we're currently running on Tomcat in the server,
>>> so we wanted to find out if the "receiving" threads 
>>> (WebSocketClient-AsyncIO) is coming from the same NIO connector 
>>> threadpool, or from somewhere else.
>>> 
>>> Q2: is the underlying AsynchronousSocketChannel receiving
>>> threadpool configurable?
>>> 
>>> -          when running as a standalone java se client app
>>> 
>>> -          and, when running within Tomcat as a websocket server
>> 
>> It is a separate thread pool and is non-configurable. It is,
>> essentially, unlimited. AsynchronousSocketChannel has a default
>> AsynchronousChannelGroup (which provides the threads) and Tomcat
>> uses a custom one that mimics the default with the exception that
>> it sets a useful thread name.
>> 
> 
> Thanks.  One final clarification: when creating the thread pool, what
> are the MIN/MAX thread values, as well as the backing Queue size?  I
> ask because Java's default behavior will use MIN threads to start.
> If all threads are busy, it will QUEUE up to max queue size.  Only if
> it exceeds max queued requests does it start adding more threads.
> Didn't know if it would be possible to overload the MIN threads and
> start queueing up inbound websocket messages.

            ExecutorService executorService = new ThreadPoolExecutor(
                    0,
                    Integer.MAX_VALUE,
                    Long.MAX_VALUE, TimeUnit.MILLISECONDS,
                    new SynchronousQueue<Runnable>(),
                    new AsyncIOThreadFactory());


Mark

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


Mime
View raw message