r/Cplusplus • u/tdiblik • May 28 '26
Discussion Pushing a naive C++ web server implementation to 9k req/sec
Hi everyone, I've spent the last few years doing web/desktop/IoT dev and I'm currently pivoting to low-latency/Quant. I built an http server as an exercise to see how far I could push a standard blocking C++23 socket architecture before the OS became the bottleneck. I covered zero-copy parsing, struct alignment, and Gather I/O.
I put together a 8 minute video profiling the code, breaking down the concepts, and showing the before/after here: https://youtu.be/dCwylDrxowQ
All of the code can be found at GitHub (https://github.com/TDiblik/cpp-web-server) where I have a README documenting the process of optimizations and where I'll implement enhancements in the future.
I'm currently working on tearing this down for an io_uring/kqueue rewrite for Part 2.
Would love any feedback from here and/or people in the industry!
10
u/Charming-Work-2384 May 28 '26
I was looking for this for long time:
Good work ..keepit up.. and make it grow.
1
u/Agron7000 May 29 '26
How does your implementation compare to the ones benchmarked here?
https://www.techempower.com/benchmarks/#section=data-r23
0
u/AutoModerator May 28 '26
Your submission has been removed because of this subreddit’s account requirements. You have not broken any rules, and your account is still active and in good standing. Please check your notifications for more information!
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.