Skip to content

Commit 5af9a7e

Browse files
authored
Merge pull request #41 from BennyFranciscus/blitz-uring-fix
blitz: fix io_uring stability + re-enable as default backend
2 parents 054c072 + 93c500a commit 5af9a7e

24 files changed

Lines changed: 34 additions & 8242 deletions

frameworks/blitz/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
FROM debian:bookworm-slim AS build
2-
RUN apt-get update && apt-get install -y wget xz-utils && \
2+
RUN apt-get update && apt-get install -y wget xz-utils ca-certificates && \
33
wget -q https://ziglang.org/download/0.14.0/zig-linux-x86_64-0.14.0.tar.xz && \
44
tar xf zig-linux-x86_64-0.14.0.tar.xz && \
55
mv zig-linux-x86_64-0.14.0 /usr/local/zig
@@ -11,5 +11,6 @@ RUN zig build -Doptimize=ReleaseFast
1111

1212
FROM debian:bookworm-slim
1313
COPY --from=build /app/zig-out/bin/blitz /server
14+
ENV BLITZ_URING=1
1415
EXPOSE 8080
1516
CMD ["/server"]

frameworks/blitz/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -725,6 +725,14 @@ zig build test
725725

726726
blitz is built to compete in [HttpArena](https://github.com/MDA2AV/HttpArena) benchmarks. See `meta.json` for the benchmark configuration.
727727

728+
### Noisy profile 4xx responses
729+
730+
The noisy benchmark profile uses 5 request templates, some of which intentionally target non-existent routes. This means 30–50% of responses will be 4xx (404) — this is **expected behavior**, not a bug. The server correctly returns 404 for unknown routes. The benchmark harness counts these as valid responses. Per-template breakdown:
731+
732+
- Templates 1–2: existing routes → ~100% 2xx
733+
- Templates 3–4: non-existent routes → ~100% 4xx (correct 404s)
734+
- Template 5: POST with body to a route that may time out at high concurrency
735+
728736
## License
729737

730738
MIT

frameworks/blitz/build.zig

Lines changed: 4 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,12 @@ pub fn build(b: *std.Build) void {
44
const target = b.standardTargetOptions(.{});
55
const optimize = b.standardOptimizeOption(.{});
66

7-
// Blitz framework module
8-
const blitz_mod = b.addModule("blitz", .{
9-
.root_source_file = b.path("src/blitz.zig"),
7+
// Pull blitz as a package dependency
8+
const blitz_dep = b.dependency("blitz", .{
109
.target = target,
1110
.optimize = optimize,
1211
});
13-
14-
// Example app (separate step — not built by default)
15-
const example = b.addExecutable(.{
16-
.name = "hello",
17-
.root_source_file = b.path("examples/hello.zig"),
18-
.target = target,
19-
.optimize = optimize,
20-
.single_threaded = false,
21-
});
22-
example.root_module.addImport("blitz", blitz_mod);
23-
example.linkLibC();
24-
const install_example = b.addInstallArtifact(example, .{});
25-
const example_step = b.step("example", "Build the example app");
26-
example_step.dependOn(&install_example.step);
12+
const blitz_mod = blitz_dep.module("blitz");
2713

2814
// HttpArena benchmark server
2915
const exe = b.addExecutable(.{
@@ -33,6 +19,7 @@ pub fn build(b: *std.Build) void {
3319
.optimize = optimize,
3420
.single_threaded = false,
3521
});
22+
exe.root_module.addImport("blitz", blitz_mod);
3623
exe.linkLibC();
3724
b.installArtifact(exe);
3825

@@ -41,14 +28,4 @@ pub fn build(b: *std.Build) void {
4128
run_cmd.step.dependOn(b.getInstallStep());
4229
const run_step = b.step("run", "Run the server");
4330
run_step.dependOn(&run_cmd.step);
44-
45-
// Tests
46-
const tests = b.addTest(.{
47-
.root_source_file = b.path("src/blitz.zig"),
48-
.target = target,
49-
.optimize = optimize,
50-
});
51-
const run_tests = b.addRunArtifact(tests);
52-
const test_step = b.step("test", "Run unit tests");
53-
test_step.dependOn(&run_tests.step);
5431
}

frameworks/blitz/build.zig.zon

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
.{
2-
.name = .blitz,
2+
.name = .httparena_blitz,
33
.version = "0.1.0",
4-
.fingerprint = 0xe8a54ff4e60f9038,
4+
.fingerprint = 0xb94d0e9e25eb1955,
55
.paths = .{
66
"build.zig",
77
"build.zig.zon",
88
"src",
99
},
10+
.dependencies = .{
11+
.blitz = .{
12+
.url = "https://github.com/BennyFranciscus/blitz/archive/541cd3bae622b76e76c3c8b68d5f50825e38d75c.tar.gz",
13+
.hash = "blitz-0.1.0-OJAP5jf0BABVpa50QwnJV50pDkAVhriR21R3sR7OfagO",
14+
},
15+
},
1016
}

frameworks/blitz/meta.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"display_name": "blitz",
33
"language": "Zig",
44
"type": "engine",
5-
"engine": "epoll",
5+
"engine": "io_uring",
66
"description": "Custom Zig HTTP server with dual epoll/io_uring backends. Zero-copy parsing, pre-computed responses, pipeline batching.",
77
"repo": "https://github.com/BennyFranciscus/blitz",
88
"enabled": true,

frameworks/blitz/src/blitz.zig

Lines changed: 0 additions & 172 deletions
This file was deleted.

0 commit comments

Comments
 (0)