Draft: Server performance improvements
These are the performance improvements from #40175 (closed), #40177 (closed), #40179 (closed), #40187 (closed), #40198 (closed), #40199 (closed), and #40200 (closed).
- Upgrade github.com/gorilla/websocket to v1.5.0.
- Reduce allocations in
websocketconn
. - Increase
clientIDAddrMapCapacity
. - Reduce smux
KeepAliveTimeout
on the server from 10 to 4 minutes. - Export
io.WriterTo
onSnowflakeClientConnection
to avoid allocation byio.Copy
. - Avoid
defer
inClientMap.SendQueue
. - Reduce turbotunnel queueSize from 2048 to 512.
- Reduce allocation in
QueuePacketConn.QueueIncoming
andQueuePacketSize.WriteTo
. - Dial ExtORPort from different localhost IP addresses.
- Use multiple parallel KCP state machines.
The branch associated with this merge request currently combines a lot of different improvements, for the sake of helping to keep track of what versions have been deployed and when. When things settle down we can review and merge the changes separately.
Edited by David Fifield