Minato is a demo project — a high-performance WebSocket server built on the Linux io_uring kernel interface, created for learning and experimentation purposes.
Traditional WebSocket servers rely on blocking I/O (one thread per connection) or non-blocking I/O with epoll. Both approaches have drawbacks — blocking I/O doesn't scale, and epoll still requires system calls for every read/write operation.
io_uring goes further by supporting fully asynchronous I/O with submission and completion queues in shared memory, dramatically reducing system call overhead.
| Directory | Description |
|---|---|
src/runtime |
System-level I/O (io_uring integration) |
src/net |
TCP server, connection management, send/receive |
src/protocol |
HTTP and WebSocket protocol parsing |
src/net/handler.rs |
Handler traits for HTTP routes and WebSocket events |
src/queue |
Lock-free ring buffer and MPSC queue implementations |
src/adapter |
Router adapters (e.g., matchit-based HTTP routing) |
Requirements: Linux with kernel 5.6+ (io_uring support)
# Run the example server
cargo run --example http_ws_server
# Run benchmarks
cargo benchA complete HTTP + WebSocket echo server demonstrating:
- HTTP routing with path parameters (
GET /users/{id}) - Health check endpoint (
GET /health) - Request body echo (
POST /api/echo) - WebSocket upgrade and echo handler (
GET /ws)
cargo run --example http_ws_server
# Test HTTP
curl http://127.0.0.1:8080/health
curl http://127.0.0.1:8080/users/42
# Test WebSocket
websocat ws://127.0.0.1:8080/ws- ws_bench — WebSocket throughput benchmark (vs tokio-tungstenite + axum)
- ring_buffer — Lock-free ring buffer performance benchmark
cargo bench --bench ws_bench
cargo bench --bench ring_buffer