Vladislav Pyatkov created IGNITE-26002:
------------------------------------------

             Summary: Network thread even distribution
                 Key: IGNITE-26002
                 URL: https://issues.apache.org/jira/browse/IGNITE-26002
             Project: Ignite
          Issue Type: Improvement
            Reporter: Vladislav Pyatkov


h3. Motivation

Network threads are distributed by Netty's internal algorithm or by hash after 
a handshake.
{code}
private static EventLoop eventLoopForKey(ChannelKey channelKey, 
ChannelEventLoopsSource eventLoopsSource) {
    List<EventLoop> eventLoops = eventLoopsSource.channelEventLoops();

    int index = safeAbs(channelKey.hashCode()) % eventLoops.size();

    return eventLoops.get(index);
}
{code}
They both ways are exposed to collision (choose the same threads for two 
different nodes). In the case of a small amount of nodes, a collision leads to 
a loading imbalance and throughput decreasing.
{noformat}
[consistentId=poc-tester-SERVER-172.25.4.33-id-0, 
launchId=133e162c-5988-45cf-8266-944e67006af0, connectionId=1]: (index 49, 
thread poc-tester-SERVER-172.25.4.113-id-0-network-worker-50)
[consistentId=poc-tester-SERVER-172.25.4.97-id-0, 
launchId=60ee5d7d-e5ec-4d44-abd7-fcb953682d9f, connectionId=1]: (index 49, 
thread poc-tester-SERVER-172.25.4.113-id-0-network-worker-50)
[consistentId=poc-tester-SERVER-172.25.4.33-id-0, 
launchId=133e162c-5988-45cf-8266-944e67006af0, connectionId=0]: (index 48, 
thread poc-tester-SERVER-172.25.4.113-id-0-network-worker-49)
[consistentId=poc-tester-SERVER-172.25.4.97-id-0, 
launchId=60ee5d7d-e5ec-4d44-abd7-fcb953682d9f, connectionId=0]: (index 48, 
thread poc-tester-SERVER-172.25.4.113-id-0-network-worker-49) 
{noformat}

h3. Definition of done
Threads are distributed evenly among all Netty message handlers.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to