87 points · by noboruma · 1y ago · 26 comments
https://github.com/noboruma/go-msquic
The project is quite new, but we have seen good performance results with it so far. PRs are welcome!
The memory bus on that system probably pushes at least ~400 Gbps, and even a fairly simple memcpy() implementation could probably push ~100 Gbps even at standard MTU (i.e. small) sizes. So that would be ~14 copies worth of execution cost per bit. That seems extremely high especially given how much people complain about the number of copies which, by this metric, would only cost ~7% per extra full copy.
Whether it's "considered fast" is better answered by simply comparing the practical numbers, like in that dashboard, rather than supposition. This kind of question is more aimed at trying to find out "how fast could it possibly be".
With Quic, yes. I don’t have hands on experience with this lib but throughput is not the strength of quic. In fact, that’s true for untuned UDP in general. Oftentimes CPU will bottleneck without bespoke platform-specific hacks to avoid the one syscall per 1260 bytes default/portable status quo.
I don’t know that bench but throughput varies wildly between environments, cross traffic and a number of mystical parameters.
What are the actual exemplary implementations because ~7 Gbps per core seems really slow for an actual quality production implementation based on my read of the QUIC standard.
That's the reason we decided to go ahead and see how it performs within our Go lang code base.
On our setup we are seeing a 50% latency reduction compared with other implementations. Definitely worth a try if you are looking for performance.
I would guess that it's not a single core benchmark and that's the speed of the overall multi-threaded system.
> Is that considered fast?
You can squeeze out around 5GB/s/core with current fastest standard tls1.3 algorithm (AES128GCM). 10+GB/s is possible with aegis variants that are somewhat popular as an extension to TLS libs.
Also, it would be silly to bottleneck your protocol implementation benchmark on encryption that would be shared amongst implementations because that does not highlight your overhead advantages. In addition, the benchmarking RFC explicitly allows for the null encryption case in benchmarking for exactly that reason.
Given the machine the benchmarks are running on has a 50 Gbps NIC, that would be double stupid since their bottleneck would then need to be the production side not producing enough data to show how fast their implementation is or bad network configuration doing the same.
And that all assumes they are not bypassing the NIC entirely since they are benchmarking the protocol implementation so the source of packets is largely irrelevant except for making sure they are not still in the cache after the producer synthesizes them.
Beyond that we look to memory bandwidth as a fundamental limiting factor on data shuffling from packets to the protocol client to attempt to bound the theoretical maximum throughput so we can see how far off a protocol implementation is from the theoretical maximum.
Windows TCP/TLS: 21.6 Gbps, Linux TCP/TLS: 19.7 Gbps, Windows QUIC (kernel): 14.3 Gbps, Windows QUIC (user): 12.8 Gbps, Linux QUIC: 7.33 Gbps, Windows QUIC (xdp): 6.86 Gbps
I would also like to add that work on these tests are very much still a work in progress, and we likely can get some/all of these numbers higher with tuning.
It's not Go then
go-msquic is a Go wrapper for the Microsoft's QUIC library
So it's only the HN headline that is (technically) wrong.It is mentioned & advised to use that one in the README. However if you need more perf, you might want to give a try at go-msquic.