Skip to content

Draft: Server performance improvements

David Fifield requested to merge dcf/snowflake:server-perf.1 into main

These are the performance improvements from #40175 (closed), #40177 (closed), #40179 (closed), #40187 (closed), #40198 (closed), #40199 (closed), and #40200 (closed).

  1. Upgrade github.com/gorilla/websocket to v1.5.0.
  2. Reduce allocations in websocketconn.
  3. Increase clientIDAddrMapCapacity.
  4. Reduce smux KeepAliveTimeout on the server from 10 to 4 minutes.
  5. Export io.WriterTo on SnowflakeClientConnection to avoid allocation by io.Copy.
  6. Avoid defer in ClientMap.SendQueue.
  7. Reduce turbotunnel queueSize from 2048 to 512.
  8. Reduce allocation in QueuePacketConn.QueueIncoming and QueuePacketSize.WriteTo.
  9. Dial ExtORPort from different localhost IP addresses.
  10. 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

Merge request reports