Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions frameworks/tokio-uring/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
target
.git
1 change: 1 addition & 0 deletions frameworks/tokio-uring/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/target
253 changes: 253 additions & 0 deletions frameworks/tokio-uring/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions frameworks/tokio-uring/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[package]
name = "httparena-tokio-uring"
version = "0.1.0"
edition = "2021"

[dependencies]
tokio-uring = "0.5"
socket2 = { version = "0.5", features = ["all"] }

[profile.release]
codegen-units = 1
lto = "thin"
opt-level = 3
panic = "abort"
13 changes: 13 additions & 0 deletions frameworks/tokio-uring/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM rust:1.95 AS build
WORKDIR /app
COPY Cargo.toml Cargo.lock ./
RUN mkdir src && echo "fn main() {}" > src/main.rs \
&& cargo build --release \
&& rm -rf src target/release/httparena-tokio-uring target/release/deps/httparena_tokio_uring*
COPY src ./src
RUN RUSTFLAGS="-C target-cpu=native" cargo build --release

FROM debian:bookworm-slim
COPY --from=build /app/target/release/httparena-tokio-uring /server
EXPOSE 8080
CMD ["/server"]
24 changes: 24 additions & 0 deletions frameworks/tokio-uring/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# tokio-uring

A minimal **HTTP/1.1** server on **tokio-uring** — the io_uring-backed Rust
runtime with a completion/owned-buffer API — for the H1-isolated profiles
(`baseline`, `pipelined`, `limited-conn`). No HTTP framework.

## Serving model
One `tokio_uring::start` per core, each with its own `SO_REUSEPORT` listener
(`socket2` + `from_std`). Reads/writes use tokio-uring's owned-buffer model: a
`Vec<u8>` is passed by value into `read`/`write_all` and handed back, reused
across iterations. Responses are batched per read.

## Hand-rolled HTTP/1.1
Request line + headers, `Content-Length` **and** `Transfer-Encoding: chunked`
bodies, keep-alive, request pipelining, and fragmented-read reassembly.

| Endpoint | Response |
|---|---|
| `GET/POST /baseline11?a=&b=` | `text/plain` — `a + b` (+ POST body as an integer) |
| `GET /pipeline` | `text/plain` — `ok` |

io_uring requires `seccomp=unconfined` under Docker (the harness sets this;
`engine: "io_uring"` makes validate.sh enable it). `PORT` overrides the listen
port for local testing.
15 changes: 15 additions & 0 deletions frameworks/tokio-uring/meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"display_name": "tokio-uring",
"language": "Rust",
"type": "engine",
"engine": "io_uring",
"description": "Minimal HTTP/1.1 server on tokio-uring — the io_uring-backed Rust runtime with a completion/owned-buffer API. A hand-rolled request parser (Content-Length + chunked bodies, keep-alive, pipelining, fragmented reads), one runtime per core with SO_REUSEPORT. No HTTP framework.",
"repo": "https://github.com/tokio-rs/tokio-uring",
"enabled": true,
"tests": [
"baseline",
"pipelined",
"limited-conn"
],
"maintainers": []
}
Loading