Caddy compatibility for zeroserve: 3x throughput and 70% lower latency
Caddy compatibility for zeroserve: 3x throughput and 70% lower latency<br>#tech#zeroserve
zeroserve is a high-performance HTTPS server that runs eBPF scripts in userspace (intro). Now it's got a Caddy-compat mode - when provided a Caddyfile, zeroserve JIT-compiles it to eBPF and then to native x86_64/ARM64 machine code, and runs it in an io_uringevent loop.
protocol<br>server<br>throughput<br>p50<br>p99<br>peak RSS
https<br>zeroserve-clang<br>38,948 req/s<br>1.45ms<br>3.91ms<br>30.9 MiB
https<br>zeroserve-tcc<br>36,653 req/s<br>1.67ms<br>4.00ms<br>34.2 MiB
https<br>caddy<br>12,529 req/s<br>4.74ms<br>13.11ms<br>67.4 MiB
https<br>nginx<br>37,424 req/s<br>1.57ms<br>4.24ms<br>25.7 MiB
HTTPS reverse proxy, 2 threads, AMD Ryzen 7 3700X. Check CI for original run result.
Try it with your Caddyfile:
curl -fL -o zeroserve https://github.com/losfair/zeroserve/releases/download/v0.2.11/zeroserve-$(uname -m)-linux<br>chmod +x zeroserve<br>./zeroserve --caddy /etc/caddy/Caddyfile<br>curl http://127.0.0.1:8080
zeroserve runs turing-complete eBPF and you can call custom code from your Caddyfile. For example, to<br>reverse-proxy a path to an S3-compatible bucket with AWS SigV4 auth, grab io.su3.aws-sigv4.c and then:
# zeroserve --plugin io.su3.aws-sigv4.c --caddy Caddyfile
example.com {<br>route /s3/* {<br>uri strip_prefix /s3<br>rewrite * /my-bucket{uri}
# Call the `sign_request` method in the eBPF middleware `io.su3.aws-sigv4.o`<br>zeroserve_call io.su3.aws-sigv4 sign_request {<br>access_key_id "minioadmin"<br>secret_access_key "minioadmin"
reverse_proxy http://127.0.0.1:9000
2026-06-14<br>© 2022-2026 Heyang Zhou ·<br>RSS
System Status