5 million HTTP/3 requests per second

Early performance testing of QUIC support in uWebSockets on M1 MacBook Air

uNetworking AB
2 min readMay 12, 2022

uWebSockets is an HTTP & WebSocket server library, getting QUIC and HTTP/3 support soon. Right now there is a minimal, highly incomplete and experimental example, recently benchmarked.

Compile with “WITH_BORINGSSL=1 WITH_QUIC=1 make”

This example is a simple but complete HTTP/3 server with header compression and a simple response. The idea will be to keep existing uWebSockets interfaces unmodified, allowing seamless transition between TCP, TLS and QUIC. Ideally even WebTransport will be supported under a similar interface as WebSockets.

uWS::App, uWS::SSLApp and uWS::QuicApp come with the same interfaces.

HTTP/3 is based on QUIC, which is based on UDP so we have a new system for that. Using sendmmsg and recvmmsg we can do 3 syscalls per loop iteration; epoll_wait, recvmmsg and sendmmsg. Regardless whether we have 1 or 10000 connections, only one single system level socket is used and so all incoming and outgoing traffic flows through one single file descriptor. This means that practically all memory overhead is in user space alone (space benchmarks will follow). It also means multiple QUIC connections can be handled with one syscall, which is not the case when having one TCP file descriptor and socket per TCP connection.

These initial benchmarks run on the M1 MacBook Air and are roughly extrapolated from a single-thread performance of 800k requests per second — 5 million is a rough extrapolation at this point, so take it with a grain of salt, but it should be very close to that. This is quite impressive as the laptop is fanless and thin — if you slash fast enough I bet you can shave with it.

Things are still being developed and highly incomplete but these are encouraging numbers showing things move in the right direction. More updates are to come in the near future.