Use multiple parallel KCP state machines
I have a suspicion that KCP packet scheduling may be a bottleneck in the server.
Most of the server's processing is concurrent and scales across multiple CPU cores,
but all the traffic passes through the centralized kcp.Listener
scheduler
that is created in Transport.Listen
.
We can actually use multiple independent KCP schedulers, as long as we consistently assign the packets of one particular session to the same KCP. And we can do that using the ClientID associated with each session.
I have a branch for this at https://gitlab.torproject.org/dcf/snowflake/-/commits/multi-kcp.
I'm planning to test it as part of !100 (closed).