Skip to content

Add zeemo — Zig io_uring HTTP/1.1 engine#723

Merged
MDA2AV merged 1 commit into
MDA2AV:mainfrom
skylightis666:add-zeemo
May 18, 2026
Merged

Add zeemo — Zig io_uring HTTP/1.1 engine#723
MDA2AV merged 1 commit into
MDA2AV:mainfrom
skylightis666:add-zeemo

Conversation

@skylightis666
Copy link
Copy Markdown
Contributor

Description

Adds zeemo, a bare-metal Zig HTTP/1.1 server built directly on Linux io_uring syscalls — the first Zig entry in HttpArena.

Subscribes to the baseline and json profiles. Submitted as type: engine.

Implementation highlights:

  • Direct io_uring (no liburing wrapper) — multishot accept, one ring per worker
  • One worker process per allowed CPU via SO_REUSEPORT, each pinned with sched_setaffinity; fully shared-nothing
  • Hand-written incremental HTTP/1.1 parser: TCP fragmentation across recv() calls, Content-Length + Transfer-Encoding: chunked bodies, keep-alive, pipelining
  • Dataset loaded once before fork; per-item JSON prefixes pre-rendered at startup, each request appends ,"total":<price*quantity*m>} per item (allowed under engine rules)
  • Static musl binary on scratch, ~370 KB

Local validation: All 17 checks from scripts/validate.sh pass locally (baseline GET/POST/chunked, anti-cheat with randomized inputs, four TCP-fragmentation splits, JSON shape for counts 12/22/31/50 with multipliers, Content-Type headers).

Source repo: https://github.com/skylightis666/zeemo


PR Commands — comment on this PR to trigger (requires collaborator approval):

Command Description
/benchmark -f zeemo Run all benchmark tests
/benchmark -f zeemo -t baseline Run a specific test
/benchmark -f zeemo --save Run and save results (updates leaderboard on merge)

Bare-metal Zig server built directly on Linux io_uring syscalls (no
liburing wrapper). One reactor process per allowed CPU via SO_REUSEPORT,
each pinned with sched_setaffinity. Hand-written incremental HTTP/1.1
parser handles TCP fragmentation, chunked transfer encoding, keep-alive,
and pipelining. Static musl binary on scratch (~370 KB).

Subscribes to: baseline, json
@MDA2AV
Copy link
Copy Markdown
Owner

MDA2AV commented May 18, 2026

/benchmark -f zeemo

@github-actions
Copy link
Copy Markdown
Contributor

👋 /benchmark request received. A collaborator will review and approve the run.

@github-actions
Copy link
Copy Markdown
Contributor

Benchmark Results

Framework: zeemo | Test: all tests

Test Conn RPS CPU Mem Δ RPS Δ Mem
baseline 512 4,164,966 6348.2% 72MiB NEW NEW
baseline 4096 4,437,510 6415.9% 187MiB NEW NEW
json 4096 2,370,352 5846.5% 290MiB NEW NEW
Full log

[run 1/3]
gcannon v0.5.3
  Target:    localhost:8080/
  Threads:   64
  Conns:     4096 (64/thread)
  Pipeline:  1
  Req/conn:  unlimited (keep-alive)
  Templates: 3
  Expected:  200
  Duration:  5s


  Thread Stats   Avg      p50      p90      p99    p99.9
    Latency    926us    921us   1.10ms   1.21ms   1.37ms

  22095570 requests in 5.00s, 22095569 responses
  Throughput: 4.42M req/s
  Bandwidth:  278.01MB/s
  Status codes: 2xx=22095569, 3xx=0, 4xx=0, 5xx=0
  Latency samples: 22095503 / 22095569 responses (100.0%)
  Per-template: 7384954,7374137,7336412
  Per-template-ok: 7384954,7374137,7336412
[info] CPU 6274.5% | Mem 179MiB

[run 2/3]
gcannon v0.5.3
  Target:    localhost:8080/
  Threads:   64
  Conns:     4096 (64/thread)
  Pipeline:  1
  Req/conn:  unlimited (keep-alive)
  Templates: 3
  Expected:  200
  Duration:  5s


  Thread Stats   Avg      p50      p90      p99    p99.9
    Latency    922us    899us   1.12ms   1.35ms   1.50ms

  22187553 requests in 5.00s, 22187552 responses
  Throughput: 4.44M req/s
  Bandwidth:  279.19MB/s
  Status codes: 2xx=22187552, 3xx=0, 4xx=0, 5xx=0
  Latency samples: 22187488 / 22187552 responses (100.0%)
  Per-template: 7377984,7413952,7395552
  Per-template-ok: 7377984,7413952,7395551
[info] CPU 6415.9% | Mem 187MiB

[run 3/3]
gcannon v0.5.3
  Target:    localhost:8080/
  Threads:   64
  Conns:     4096 (64/thread)
  Pipeline:  1
  Req/conn:  unlimited (keep-alive)
  Templates: 3
  Expected:  200
  Duration:  5s


  Thread Stats   Avg      p50      p90      p99    p99.9
    Latency    925us    908us   1.09ms   1.35ms   1.48ms

  22119111 requests in 5.00s, 22118895 responses
  Throughput: 4.42M req/s
  Bandwidth:  278.36MB/s
  Status codes: 2xx=22118895, 3xx=0, 4xx=0, 5xx=0
  Latency samples: 22118833 / 22118895 responses (100.0%)
  Per-template: 7376573,7382740,7359520
  Per-template-ok: 7376573,7382740,7359520
[info] CPU 6253.2% | Mem 190MiB

=== Best: 4437510 req/s (CPU: 6415.9%, Mem: 187MiB) ===
[info] input BW: 342.79MB/s (avg template: 81 bytes)
[info] saved results/baseline/4096/zeemo.json
httparena-bench-zeemo
httparena-bench-zeemo
[info] skip: zeemo does not subscribe to pipelined
[info] skip: zeemo does not subscribe to limited-conn

==============================================
=== zeemo / json / 4096c (tool=gcannon) ===
==============================================
[info] waiting for server...
[info] server ready

[run 1/3]
gcannon v0.5.3
  Target:    localhost:8080/
  Threads:   64
  Conns:     4096 (64/thread)
  Pipeline:  1
  Req/conn:  25
  Templates: 7
  Expected:  200
  Duration:  5s


  Thread Stats   Avg      p50      p90      p99    p99.9
    Latency    677us    350us   1.94ms   2.90ms   3.55ms

  11703799 requests in 5.00s, 11703609 responses
  Throughput: 2.34M req/s
  Bandwidth:  7.83GB/s
  Status codes: 2xx=11703609, 3xx=0, 4xx=0, 5xx=0
  Latency samples: 11703515 / 11703609 responses (100.0%)
  Reconnects: 466931
  Per-template: 1665885,1669317,1672406,1676267,1677009,1674229,1668402
  Per-template-ok: 1665885,1669317,1672406,1676267,1677009,1674229,1668402
[info] CPU 5720.0% | Mem 262MiB

[run 2/3]
gcannon v0.5.3
  Target:    localhost:8080/
  Threads:   64
  Conns:     4096 (64/thread)
  Pipeline:  1
  Req/conn:  25
  Templates: 7
  Expected:  200
  Duration:  5s


  Thread Stats   Avg      p50      p90      p99    p99.9
    Latency    677us    359us   1.91ms   2.92ms   3.53ms

  11727528 requests in 5.00s, 11727461 responses
  Throughput: 2.34M req/s
  Bandwidth:  7.85GB/s
  Status codes: 2xx=11727461, 3xx=0, 4xx=0, 5xx=0
  Latency samples: 11727382 / 11727461 responses (100.0%)
  Reconnects: 469957
  Per-template: 1668968,1672338,1676217,1680113,1680866,1677535,1671345
  Per-template-ok: 1668968,1672338,1676217,1680113,1680866,1677535,1671345
[info] CPU 6357.6% | Mem 279MiB

[run 3/3]
gcannon v0.5.3
  Target:    localhost:8080/
  Threads:   64
  Conns:     4096 (64/thread)
  Pipeline:  1
  Req/conn:  25
  Templates: 7
  Expected:  200
  Duration:  5s


  Thread Stats   Avg      p50      p90      p99    p99.9
    Latency    685us    363us   1.91ms   2.93ms   3.56ms

  11851779 requests in 5.00s, 11851762 responses
  Throughput: 2.37M req/s
  Bandwidth:  7.93GB/s
  Status codes: 2xx=11851762, 3xx=0, 4xx=0, 5xx=0
  Latency samples: 11851685 / 11851762 responses (100.0%)
  Reconnects: 474909
  Per-template: 1687251,1690801,1694093,1697464,1697479,1695190,1689407
  Per-template-ok: 1687251,1690801,1694093,1697464,1697479,1695190,1689407
[info] CPU 5846.5% | Mem 290MiB

=== Best: 2370352 req/s (CPU: 5846.5%, Mem: 290MiB) ===
[info] input BW: 113.03MB/s (avg template: 50 bytes)
[info] saved results/json/4096/zeemo.json
httparena-bench-zeemo
httparena-bench-zeemo
[info] skip: zeemo does not subscribe to json-comp
[info] skip: zeemo does not subscribe to json-tls
[info] skip: zeemo does not subscribe to upload
[info] skip: zeemo does not subscribe to api-4
[info] skip: zeemo does not subscribe to api-16
[info] skip: zeemo does not subscribe to static
[info] skip: zeemo does not subscribe to async-db
[info] skip: zeemo does not subscribe to crud
[info] skip: zeemo does not subscribe to fortunes
[info] skip: zeemo does not subscribe to baseline-h2
[info] skip: zeemo does not subscribe to static-h2
[info] skip: zeemo does not subscribe to baseline-h2c
[info] skip: zeemo does not subscribe to json-h2c
[info] skip: zeemo does not subscribe to baseline-h3
[info] skip: zeemo does not subscribe to static-h3
[info] skip: zeemo does not subscribe to gateway-64
[info] skip: zeemo does not subscribe to gateway-h3
[info] skip: zeemo does not subscribe to production-stack
[info] skip: zeemo does not subscribe to unary-grpc
[info] skip: zeemo does not subscribe to unary-grpc-tls
[info] skip: zeemo does not subscribe to stream-grpc
[info] skip: zeemo does not subscribe to stream-grpc-tls
[info] skip: zeemo does not subscribe to echo-ws
[info] skip: zeemo does not subscribe to echo-ws-pipeline
[info] rebuilding site/data/*.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/frameworks.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/baseline-4096.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/baseline-512.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/json-4096.json
[updated] /home/diogo/actions-runner/_work/HttpArena/HttpArena/site/data/current.json
[info] done
[info] restoring loopback MTU to 65536
[info] restoring CPU governor → powersave

@MDA2AV
Copy link
Copy Markdown
Owner

MDA2AV commented May 18, 2026

/benchmark -f zeemo --save

@github-actions
Copy link
Copy Markdown
Contributor

👋 /benchmark request received. A collaborator will review and approve the run.

@github-actions
Copy link
Copy Markdown
Contributor

⚠️ /benchmark --save cannot start: main has diverged and cannot be auto-merged into this branch. Please merge or rebase main manually, push, and re-run /benchmark --save.

@MDA2AV MDA2AV merged commit d6938fd into MDA2AV:main May 18, 2026
4 checks passed
@skylightis666
Copy link
Copy Markdown
Contributor Author

Hey @MDA2AV — thanks for merging! Noticed the /benchmark --save run earlier couldn't proceed because the branch had diverged from main. Since zeemo source is on main now, would it be possible to kick off the Benchmark workflow manually with framework=zeemo? That should run against main and open the results PR. Happy to help with anything else needed to land the numbers on the leaderboard.

@github-actions
Copy link
Copy Markdown
Contributor

👋 /benchmark request received. A collaborator will review and approve the run.

@github-actions
Copy link
Copy Markdown
Contributor

⚠️ /benchmark --save cannot start: main has diverged and cannot be auto-merged into this branch. Please merge or rebase main manually, push, and re-run /benchmark --save.

@MDA2AV
Copy link
Copy Markdown
Owner

MDA2AV commented May 18, 2026

Hey @MDA2AV — thanks for merging! Noticed the /benchmark --save run earlier couldn't proceed because the branch had diverged from main. Since zeemo source is on main now, would it be possible to kick off the Benchmark workflow manually with framework=zeemo? That should run against main and open the results PR. Happy to help with anything else needed to land the numbers on the leaderboard.

Hey, I am running it on main already directly on server, skipped the rebase because I am next to the server machine. Results should be up soon

Repository owner deleted a comment from github-actions Bot May 18, 2026
Repository owner deleted a comment from github-actions Bot May 18, 2026
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.

2 participants