From 5efc9fc96824e8a6b40839819a390ce3309f5b19 Mon Sep 17 00:00:00 2001 From: prothegee Date: Thu, 18 Jun 2026 01:30:45 +0700 Subject: [PATCH 1/4] bump to zix 0.4.x-rc3 for ws test --- frameworks/zix-ws/Dockerfile | 6 +++--- frameworks/zix-ws/src/main.zig | 16 +++++++++++++--- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/frameworks/zix-ws/Dockerfile b/frameworks/zix-ws/Dockerfile index ed8f0aaf6..13da3e499 100644 --- a/frameworks/zix-ws/Dockerfile +++ b/frameworks/zix-ws/Dockerfile @@ -5,7 +5,7 @@ ARG RETRY=6 ARG TARGETARCH ARG RETRY_DELAY=3 ARG ZIG_VERSION=0.16.0 -ARG ZIX_VERSION=0.4.x +ARG ZIX_VERSION=0.4.x-rc3 RUN apk add --no-cache ca-certificates curl git tar xz RUN set -eu; \ @@ -19,9 +19,9 @@ RUN set -eu; \ mv "/opt/zig-${ZIG_ARCH}-linux-${ZIG_VERSION}" /opt/zig ENV PATH="/opt/zig:${PATH}" -# Vendor zix 0.4.x, separate layer so source-only rebuilds skip the fetch. +# Vendor zix X.Y.Z, separate layer so source-only rebuilds skip the fetch. # The Http1 raw engine work this image needs (large-body drain plus the per-worker -# response cache used by the /json endpoint) must be present on the 0.4.x branch. +# response cache used by the /json endpoint) must be present on the X.Y.Z branch. # Four ordered attempts before giving up: curl the archive tarball from github then # codeberg, then a shallow git clone from github then codeberg. The github archive # redirects to codeload.github.com (which the benchmark runner may not resolve), so diff --git a/frameworks/zix-ws/src/main.zig b/frameworks/zix-ws/src/main.zig index ebf024f46..a7b25a812 100644 --- a/frameworks/zix-ws/src/main.zig +++ b/frameworks/zix-ws/src/main.zig @@ -1,5 +1,4 @@ //! HttpArena: zix-ws -//! zix version: 0.4.x //! //! zix HttpArena WebSocket entry point. //! @@ -20,9 +19,20 @@ const zix = @import("zix"); const PORT: u16 = 8080; const LISTEN_IP: []const u8 = "::"; -const DISPATCH_MODEL: zix.Http1.DispatchModel = .URING; +const DISPATCH_MODEL: zix.Http1.DispatchModel = .EPOLL; const KERNEL_BACKLOG: u31 = 16 * 1024; -const MAX_RECV_BUF: usize = 4 * 1024; + +/// Per-machine tuning profile (ADR-041 increment 5): .lean for the 12-thread / +/// 32 GB dev box, .throughput for the 64-core / 251 GB competition box. Only the +/// HTTP handshake recv buffer differs (the WS frame buffer is already 32 KiB). +/// Select .throughput for the 64-core deployment. +const Profile = enum { lean, throughput }; +const PROFILE: Profile = .lean; + +const MAX_RECV_BUF: usize = switch (PROFILE) { + .lean => 4 * 1024, + .throughput => 16 * 1024, +}; const WS_RECV_BUF: usize = 32 * 1024; const MAX_HEADERS: u8 = 16; const WORKERS: usize = 0; From 532ec06151d18c310a35a0ebbb608fbb471d1b56 Mon Sep 17 00:00:00 2001 From: prothegee Date: Thu, 18 Jun 2026 03:35:47 +0700 Subject: [PATCH 2/4] direct chose io_uring --- frameworks/zix-ws/src/main.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frameworks/zix-ws/src/main.zig b/frameworks/zix-ws/src/main.zig index a7b25a812..05adac321 100644 --- a/frameworks/zix-ws/src/main.zig +++ b/frameworks/zix-ws/src/main.zig @@ -19,7 +19,7 @@ const zix = @import("zix"); const PORT: u16 = 8080; const LISTEN_IP: []const u8 = "::"; -const DISPATCH_MODEL: zix.Http1.DispatchModel = .EPOLL; +const DISPATCH_MODEL: zix.Http1.DispatchModel = .URING; const KERNEL_BACKLOG: u31 = 16 * 1024; /// Per-machine tuning profile (ADR-041 increment 5): .lean for the 12-thread / From 56bb60e649c47fc551347d31cdc7584da62eda13 Mon Sep 17 00:00:00 2001 From: prothegee Date: Thu, 18 Jun 2026 03:36:07 +0700 Subject: [PATCH 3/4] reflecting zix-ws approach --- frameworks/zix-ws/meta.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frameworks/zix-ws/meta.json b/frameworks/zix-ws/meta.json index 478ed755e..aa33e4c45 100644 --- a/frameworks/zix-ws/meta.json +++ b/frameworks/zix-ws/meta.json @@ -3,7 +3,7 @@ "language": "Zig", "type": "engine", "engine": "zix", - "description": "Zig WebSocket echo server on the zix.Http1 raw engine (no std.http). Shared-nothing: each worker runs its own SO_REUSEPORT multishot accept plus io_uring completion loop and owns its connections. The WebSocket upgrade and echo are engine-owned, frames echoed on readiness with a pipelined burst coalesced into one write.", + "description": "Zig WebSocket echo server on the zix.Http1 raw engine (no std.http). Shared-nothing by design: each worker owns its own SO_REUSEPORT multishot accept, io_uring completion ring, and connections, with no shared state or locking across cores. The upgrade and echo are engine-owned: frames are read from a shared per-worker provided-buffer ring (an idle connection holds no buffer), and a pipelined burst is coalesced into one write.", "repo": "https://codeberg.org/prothegee/zix", "enabled": true, "tests": [ From b4117c8eea8b887bead09c30c0a095bd75e8ce45 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 18 Jun 2026 14:59:29 +0000 Subject: [PATCH 4/4] Benchmark results: zix-ws --- site/data/echo-ws-16384.json | 14 +++++++------- site/data/echo-ws-4096.json | 16 ++++++++-------- site/data/echo-ws-512.json | 16 ++++++++-------- site/data/echo-ws-pipeline-16384.json | 16 ++++++++-------- site/data/echo-ws-pipeline-4096.json | 16 ++++++++-------- site/data/echo-ws-pipeline-512.json | 14 +++++++------- site/data/frameworks.json | 2 +- 7 files changed, 47 insertions(+), 47 deletions(-) diff --git a/site/data/echo-ws-16384.json b/site/data/echo-ws-16384.json index 8de26ca61..cb189231e 100644 --- a/site/data/echo-ws-16384.json +++ b/site/data/echo-ws-16384.json @@ -598,20 +598,20 @@ { "framework": "zix-ws", "language": "Zig", - "rps": 4232201, - "avg_latency": "3.81ms", - "p99_latency": "4.43ms", - "cpu": "6083.2%", + "rps": 4344058, + "avg_latency": "3.75ms", + "p99_latency": "4.36ms", + "cpu": "6407.8%", "memory": "416MiB", "connections": 16384, "threads": 64, "duration": "5s", "pipeline": 1, - "bandwidth": "28.64MB/s", + "bandwidth": "29.38MB/s", "reconnects": 0, - "status_2xx": 21161008, + "status_2xx": 21720294, "status_3xx": 0, "status_4xx": 0, "status_5xx": 0 } -] +] \ No newline at end of file diff --git a/site/data/echo-ws-4096.json b/site/data/echo-ws-4096.json index c56a9b997..511b2fde6 100644 --- a/site/data/echo-ws-4096.json +++ b/site/data/echo-ws-4096.json @@ -598,20 +598,20 @@ { "framework": "zix-ws", "language": "Zig", - "rps": 4513022, - "avg_latency": "907us", - "p99_latency": "1.21ms", - "cpu": "6420.2%", - "memory": "243MiB", + "rps": 4536341, + "avg_latency": "902us", + "p99_latency": "1.20ms", + "cpu": "6404.1%", + "memory": "246MiB", "connections": 4096, "threads": 64, "duration": "5s", "pipeline": 1, - "bandwidth": "30.12MB/s", + "bandwidth": "30.28MB/s", "reconnects": 0, - "status_2xx": 22565110, + "status_2xx": 22681708, "status_3xx": 0, "status_4xx": 0, "status_5xx": 0 } -] +] \ No newline at end of file diff --git a/site/data/echo-ws-512.json b/site/data/echo-ws-512.json index 7e217ccee..33fcde5cf 100644 --- a/site/data/echo-ws-512.json +++ b/site/data/echo-ws-512.json @@ -598,20 +598,20 @@ { "framework": "zix-ws", "language": "Zig", - "rps": 4279997, - "avg_latency": "119us", - "p99_latency": "210us", - "cpu": "6362.1%", - "memory": "189MiB", + "rps": 4321169, + "avg_latency": "117us", + "p99_latency": "200us", + "cpu": "6412.5%", + "memory": "190MiB", "connections": 512, "threads": 64, "duration": "5s", "pipeline": 1, - "bandwidth": "28.56MB/s", + "bandwidth": "28.85MB/s", "reconnects": 0, - "status_2xx": 21399989, + "status_2xx": 21605849, "status_3xx": 0, "status_4xx": 0, "status_5xx": 0 } -] +] \ No newline at end of file diff --git a/site/data/echo-ws-pipeline-16384.json b/site/data/echo-ws-pipeline-16384.json index 9b70c7225..5835b3568 100644 --- a/site/data/echo-ws-pipeline-16384.json +++ b/site/data/echo-ws-pipeline-16384.json @@ -420,20 +420,20 @@ { "framework": "zix-ws", "language": "Zig", - "rps": 53628657, - "avg_latency": "4.70ms", - "p99_latency": "8.62ms", - "cpu": "5884.0%", - "memory": "442MiB", + "rps": 50196478, + "avg_latency": "5.00ms", + "p99_latency": "8.55ms", + "cpu": "5798.4%", + "memory": "440MiB", "connections": 16384, "threads": 64, "duration": "5s", "pipeline": 16, - "bandwidth": "358.29MB/s", + "bandwidth": "335.17MB/s", "reconnects": 0, - "status_2xx": 268143289, + "status_2xx": 250982391, "status_3xx": 0, "status_4xx": 0, "status_5xx": 0 } -] +] \ No newline at end of file diff --git a/site/data/echo-ws-pipeline-4096.json b/site/data/echo-ws-pipeline-4096.json index c19803edf..2610cf33a 100644 --- a/site/data/echo-ws-pipeline-4096.json +++ b/site/data/echo-ws-pipeline-4096.json @@ -420,20 +420,20 @@ { "framework": "zix-ws", "language": "Zig", - "rps": 65562329, - "avg_latency": "994us", - "p99_latency": "2.06ms", - "cpu": "6165.1%", - "memory": "244MiB", + "rps": 66163871, + "avg_latency": "980us", + "p99_latency": "2.02ms", + "cpu": "6131.5%", + "memory": "241MiB", "connections": 4096, "threads": 64, "duration": "5s", "pipeline": 16, - "bandwidth": "437.58MB/s", + "bandwidth": "442.17MB/s", "reconnects": 0, - "status_2xx": 327811649, + "status_2xx": 331480998, "status_3xx": 0, "status_4xx": 0, "status_5xx": 0 } -] +] \ No newline at end of file diff --git a/site/data/echo-ws-pipeline-512.json b/site/data/echo-ws-pipeline-512.json index 2bd491ffd..4c3fbc5ba 100644 --- a/site/data/echo-ws-pipeline-512.json +++ b/site/data/echo-ws-pipeline-512.json @@ -420,20 +420,20 @@ { "framework": "zix-ws", "language": "Zig", - "rps": 60158423, + "rps": 60116442, "avg_latency": "135us", - "p99_latency": "296us", - "cpu": "6272.9%", - "memory": "194MiB", + "p99_latency": "314us", + "cpu": "6292.1%", + "memory": "196MiB", "connections": 512, "threads": 64, "duration": "5s", "pipeline": 16, - "bandwidth": "401.47MB/s", + "bandwidth": "401.03MB/s", "reconnects": 0, - "status_2xx": 300792116, + "status_2xx": 300582211, "status_3xx": 0, "status_4xx": 0, "status_5xx": 0 } -] +] \ No newline at end of file diff --git a/site/data/frameworks.json b/site/data/frameworks.json index 6ae2d0cb5..7e9620a6a 100644 --- a/site/data/frameworks.json +++ b/site/data/frameworks.json @@ -908,7 +908,7 @@ }, "zix-ws": { "dir": "zix-ws", - "description": "Zig WebSocket echo server on the zix.Http1 raw engine (no std.http). Shared-nothing: each worker runs its own SO_REUSEPORT multishot accept plus io_uring completion loop and owns its connections. The WebSocket upgrade and echo are engine-owned, frames echoed on readiness with a pipelined burst coalesced into one write.", + "description": "Zig WebSocket echo server on the zix.Http1 raw engine (no std.http). Shared-nothing by design: each worker owns its own SO_REUSEPORT multishot accept, io_uring completion ring, and connections, with no shared state or locking across cores. The upgrade and echo are engine-owned: frames are read from a shared per-worker provided-buffer ring (an idle connection holds no buffer), and a pipelined burst is coalesced into one write.", "repo": "https://codeberg.org/prothegee/zix", "type": "engine", "engine": "zix"