A pull request for the Microsoft .NET Runtime build on Linux to use IO_uring for sockets is showing some massive performance benefits.
Ben Adams of Illyriad Games and a .NET contributor opened the pull request to use IO_uring for sockets on Linux. This implementation is a complete, “production grade” IO_uring socket I/O engine for .NET’s System.Net.Sockets layer. With the proposed code it’s currently opt-in via the OTNET_SYSTEM_NET_SOCKETS_IO_URING=1 environment variable.
This IO_uring implementation for .NET System.Net.Sockets is a replacement to the existing epoll implementation.
For users of .NET on Linux this has the potential to deliver some very significant performance gains. Some of the benchmark results shared in the pull request include:
Kestrel HTTP/1.1 Keep-Alive (TechEmpower Plaintext)
Expected improvement: 15-40% reduction in per-request CPU cost. TechEmpower plaintext is historically syscall-bound; io_uring batching directly attacks this.
Kestrel HTTPS/TLS Workload (Common Production)
Expected improvement: 10-25% reduction in socket-layer CPU.
High Connection Count Idle Servers (WebSocket/SignalR Hubs, 10K+)
Expected improvement: 30-50% memory overhead reduction for idle connections. 10-30% wake latency improvement.
HttpClient Outbound Requests (Microservice-to-Microservice)
Expected improvement: 10-20% per-request latency reduction for short-lived connections.
Database Drivers (Npgsql, MySQL Connector, Redis)
Expected improvement: 5-15% latency reduction per query.
UDP Workloads (DNS, Game Servers, Telemetry Collectors)
Expected improvement: 20-40% increase in packets-per-second for high-rate UDP.
Accept-Heavy Workloads (Load Balancers, Proxies, Connection Bursts)
Expected improvement: 20-50% improvement in connections-per-second under burst load.
Very impressive results. There still is the possibility too of more gains from further optimizations, making use of IO_uring zero-copy receive, and other features.
More details for those interested via this open pull request to the .NET Runtime.
