[undertow-dev] Websocket connections and IO thread affinity

Jason T. Greene jason.greene at redhat.com
Thu Jun 16 14:49:22 EDT 2016


Sorry that got a bit truncated.  My next paragraph was going to ask which version you are using to see if this approach helps you. I think we'd be open to alternative balancing strategies.

> On Jun 16, 2016, at 1:41 PM, Jason T. Greene <jason.greene at redhat.com> wrote:
> 
> We recently changed xnio to balance connections by default using a strategy similar to the new SO_REUSEPORT facility in the Linux kernel (3.3.3 or later). In the short future,  we will be switching to the native facility when accessible in the JDK NIO implementation. Older versions had a feature called balancing tokens that you could use to balance connections fairly, but it had to be especially configured.  
> 
> 
>> On Jun 16, 2016, at 1:00 PM, peter royal <peter.royal at pobox.com> wrote:
>> 
>> (I believe the following is true... please correct me if not!)
>> 
>> I have an application which heavily utilizes web sockets. It is an
>> internal application which uses a small number of connections with
>> reasonable load on each.
>> 
>> When a new connection is received by Undertow, there is an
>> at-connection-time assignment of an XNIO IO Thread to the connection.
>> This is causing uneven load on my IO threads, due to chance. 
>> 
>> I'm increasing the number of IO threads as a temporary fix, but it might
>> be useful to be able to either migrate a long-lived connection to
>> another IO thread (harder) or do better load balancing amongst IO
>> threads. For the latter, if Undertow was able to provide a strategy for
>> picking a thread in NioXnioWorker.getIoThread(hashCode), it could try
>> and pick a thread that had fewer connections assigned to it.
>> 
>> Has anyone else run into this problem? Would a fix be accepted?
>> 
>> -pete
>> 
>> -- 
>> (peter.royal|osi)@pobox.com - http://fotap.org/~osi
>> _______________________________________________
>> undertow-dev mailing list
>> undertow-dev at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/undertow-dev



More information about the undertow-dev mailing list