I recently collaborated with a friend on a project where we developed an HTTP reverse proxy using Rust with some added security features like complex WAF rules and extensive IP blocklists. After thorough testing with Oha, we achieved a peak performance of 317,626 requests per second with a 100% success rate over a short period. Notably, the proxy was capable of scanning each request for OWASP vulnerabilities. Given these results, do you think a benchmark of around 300k requests per second is impressive for an 8-core, 12-thread AMD processor running a web server? Also, I'm contemplating whether to open-source this project based on its performance and features. What do you think?
3 Answers
Great work on the improvements! Preforking has really boosted your performance. If you're currently CPU-limited and only using about 5% of your RAM, this approach seems spot on. Just keep balancing those requests per second against that slowest request time to gauge overall user experience.
Your benchmark seems solid, but keep in mind that the 99th percentile latency being at around 3.7 seconds raises some concerns. Before jumping to conclusions, you should also consider how the service handles real-world loads. With your proxy handling extensive filtering and security checks for each request, I imagine real performance could vary significantly under actual usage conditions.
Using Tokio is a good choice, but profiling your application will help identify potential bottlenecks. Have you tried scaling from 1 to 8 threads? Implementing a prefork worker model could yield better results. Many have found that deducting processing time at the syscall level helps improve overall requests per second.

Related Questions
How To: Running Codex CLI on Windows with Azure OpenAI
Set Wordpress Featured Image Using Javascript
How To Fix PHP Random Being The Same
Why no WebP Support with Wordpress
Replace Wordpress Cron With Linux Cron
Customize Yoast Canonical URL Programmatically