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
6 changes: 3 additions & 3 deletions frameworks/zix-ws/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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; \
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion frameworks/zix-ws/meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down
14 changes: 12 additions & 2 deletions frameworks/zix-ws/src/main.zig
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//! HttpArena: zix-ws
//! zix version: 0.4.x
//!
//! zix HttpArena WebSocket entry point.
//!
Expand All @@ -22,7 +21,18 @@ const PORT: u16 = 8080;
const LISTEN_IP: []const u8 = "::";
const DISPATCH_MODEL: zix.Http1.DispatchModel = .URING;
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;
Expand Down
14 changes: 7 additions & 7 deletions site/data/echo-ws-16384.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
]
]
16 changes: 8 additions & 8 deletions site/data/echo-ws-4096.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
]
]
16 changes: 8 additions & 8 deletions site/data/echo-ws-512.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
]
]
16 changes: 8 additions & 8 deletions site/data/echo-ws-pipeline-16384.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
]
]
16 changes: 8 additions & 8 deletions site/data/echo-ws-pipeline-4096.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
]
]
14 changes: 7 additions & 7 deletions site/data/echo-ws-pipeline-512.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
]
]
2 changes: 1 addition & 1 deletion site/data/frameworks.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down