Caddy compatibility for zeroserve: 3x throughput and 70% lower latency
Zeroserve, a high-performance HTTPS server that runs eBPF scripts in userspace, has introduced a Caddy-compatible mode. When provided a Caddyfile, zeroserve JIT-compiles it to eBPF and then to native x86_64/ARM64 machine code, executing it in an io_uring event loop. Benchmark results from a test using an HTTPS reverse proxy with 2 threads on an AMD Ryzen 7 3700X show significant performance gains: zeroserve with clang achieved 38,948 req/s with p50 latency of 1.45ms and p99 latency of 3.91ms, while zeroserve with tcc achieved 36,653 req/s with p50 1.67ms and p99 4.00ms. In comparison, Caddy achieved 12,529 req/s with p50 4.74ms and p99 13.11ms, and nginx achieved 37,424 req/s with p50 1.57ms and p99 4.24ms. Memory usage was also lower: zeroserve-clang used 30.9 MiB peak RSS, zeroserve-tcc used 34.2 MiB, Caddy used 67.4 MiB, and nginx used 25.7 MiB. Users can try zeroserve with their Caddyfile by downloading the binary from GitHub and running it with the --caddy flag. Additionally, zeroserve supports custom eBPF middleware; for example, it can reverse-proxy to an S3-compatible bucket with AWS SigV4 auth by loading a plugin and calling the sign_request method in the Caddyfile.
Developers can replace Caddy with zeroserve for 3x throughput and 70% lower latency without changing their Caddyfile configuration.