Introduction
In the tech world where every millisecond and request per second count, enhancing HTTPS server performance is crucial. Zeroserve, a high-performance HTTPS server, recently introduced compatibility with Caddy, promising triple the throughput and 70% reduced latency. How is this possible? Let's break it down together.
What is Zeroserve?
Zeroserve is a next-generation HTTPS server that runs eBPF scripts in user space. Simply put, it uses advanced technology to optimize web application performance. The recent integration of Caddy compatibility allows Zeroserve to just-in-time compile a Caddyfile into native machine code for x86_64 and ARM64 architectures. It's all executed in an io_uring event loop, significantly boosting performance.
Numbers that Matter
Let's compare the performance of different servers in an HTTPS reverse proxy context, with two threads, on an AMD Ryzen 7 3700X processor:
- Zeroserve-clang: 38,948 requests/s, p50 latency at 1.45 ms, p99 at 3.91 ms, 30.9 MiB memory consumption.
- Zeroserve-tcc: 36,653 requests/s, p50 latency at 1.67 ms, p99 at 4.00 ms, 34.2 MiB.
- Caddy: 12,529 requests/s, p50 latency at 4.74 ms, p99 at 13.11 ms, 67.4 MiB.
- Nginx: 37,424 requests/s, p50 latency at 1.57 ms, p99 at 4.24 ms, 25.7 MiB.
Zeroserve stands out, particularly the clang version, compared to Caddy and even Nginx, another popular server known for its performance.
Leveraging Caddy with Zeroserve
Using Zeroserve with Caddy is straightforward and can radically transform the management of your web applications. Here's a quick guide to get started:
- Download Zeroserve:
``bash curl -fL -o zeroserve https://github.com/losfair/zeroserve/releases/download/v0.2.11/zeroserve-$(uname -m)-linux chmod +x zeroserve ``
- Run Zeroserve with your Caddyfile:
``bash ./zeroserve --caddy /etc/caddy/Caddyfile ``
- Access your application:
``bash curl http://127.0.0.1:8080 ``
Use Case: Reverse Proxy with AWS SigV4 Authentication
Suppose you want to set up a reverse proxy to an S3-compatible bucket using AWS SigV4 authentication. Here's how this can be achieved with Zeroserve:
``caddy example.com { route /s3/ { uri strip_prefix /s3 rewrite /my-bucket{uri} zeroserve_call io.su3.aws-sigv4 sign_request { access_key_id "minioadmin" secret_access_key "minioadmin" } reverse_proxy http://127.0.0.1:9000 } } ``
Using this simple configuration file, you can not only access your S3 resources but also benefit from Zeroserve's enhanced performance.
Conclusion
Zeroserve's Caddy compatibility represents a significant advancement for developers and companies looking to maximize their web performance. Whether it's handling high loads or reducing latency for a better user experience, Zeroserve provides an innovative and efficient solution. Ready to optimize your infrastructure? Let's discuss your project in 15 minutes.