mirror of
https://github.com/tailscale/tailscale.git
synced 2026-11-20 08:41:19 -08:00
Steering homes were the first CPU, from a point a peer's ID hashed to, not receiving from the NIC or known to be overloaded. But a CPU learned its own load only when it received from the NIC, which homes don't, so busy homes looked idle, and peers piled onto a few. Now any CPU's load comes from its idle time (get_cpu_idle_time_us, for any CPU), and a peer's home is the least loaded of 8 spread from its hash, kept while it isn't overloaded. With 37 peers on 11 of the NIC's 32 queues (this boot's RSS key), uploads through the router go from 28 to 44 Gbps, crawling from 42 to 51. Also record wireguard-go's scaling with flow count across all the scenarios, so as not to misrepresent it: 6-11 Gbps from 1 client to 37, and 1 flow each to 64, best with fewer flows, using 3-6% of the host's CPU (serialized, not CPU-bound), and unmoved by GOGC or GOMAXPROCS. And what the sweep found against tswg: on one tunnel between big hosts, both at EC2's per-flow limit, tswg uses up to 2x wireguard-go's CPU per GB; and the NIC's random RSS key decides how many queues few peers get, which swung tswg's results 2x between boots. Updates #426 Signed-off-by: Brad Fitzpatrick <[email protected]> Change-Id: I0760b24dd84f246005a4bc7c43429a016287223d