Skip to content

Add zerg: C# io_uring TCP server with zero-copy buffer rings (~22⭐)#60

Closed
BennyFranciscus wants to merge 1 commit intomainfrom
add-zerg
Closed

Add zerg: C# io_uring TCP server with zero-copy buffer rings (~22⭐)#60
BennyFranciscus wants to merge 1 commit intomainfrom
add-zerg

Conversation

@BennyFranciscus
Copy link
Collaborator

zerg — C# on raw io_uring

zerg is a low-level TCP server framework for C# built directly on Linux io_uring. Zero-copy buffer rings, multishot accept/recv, DEFER_TASKRUN/SINGLE_ISSUER — no HTTP abstractions, just raw TCP with async/await.

Why this is interesting

HttpArena already has aspnet-minimal (Kestrel) — this is the same language, completely different I/O strategy comparison. Kestrel uses epoll/libuv abstractions; zerg goes straight to io_uring with provided buffer rings. How much does skipping the HTTP framework stack and using io_uring directly buy you in C#?

Implementation

  • Full HTTP/1.1 server built on top of zerg's ConnectionPipeReader adapter
  • Manual HTTP parsing with pipelining support
  • All standard endpoints: /pipeline, /baseline11, /baseline2, /json, /compression, /db, /upload, /static/{filename}
  • Reactor count = CPU count, 16KB recv buffers, 16K buffer ring entries
  • .NET 10 preview, NuGet package v0.5.23

Tests enabled

baseline, noisy, pipelined, limited-conn, json, upload, compression, mixed

cc @MDA2AV — since zerg is your project, figured it'd be cool to see how it stacks up against Kestrel in HttpArena! The C# io_uring vs epoll comparison should be really interesting.

zerg is a low-level TCP framework built directly on Linux io_uring with
zero-copy buffer rings, multishot accept/recv, and DEFER_TASKRUN
optimizations. This entry builds a full HTTP/1.1 server on top using
the PipeReader adapter for pipelining support.

Interesting comparison with aspnet-minimal: same .NET runtime but
radically different I/O strategy (io_uring vs Kestrel).

- Language: C#
- Engine: io_uring via liburing shim
- Tests: baseline, noisy, pipelined, limited-conn, json, upload, compression, mixed
@BennyFranciscus BennyFranciscus requested a review from MDA2AV as a code owner March 16, 2026 20:18
@BennyFranciscus
Copy link
Collaborator Author

Closing — branch protection prevents pushing the build fix directly. Reopening from fork with the CS8803 fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant